[PATCH] D95199: [ELF] Write output sections in PT_LOAD segment order

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 10:23:58 PDT 2021


MaskRay added inline comments.


================
Comment at: lld/ELF/Writer.cpp:2220
+  // Sort segment sections by rising address. This means that section order
+  // does not need to match segment order in a link script.
+  for (Partition &part : partitions)
----------------
// Sort segment sections by address. For one segment, we layout sections in the order of addresses.


================
Comment at: lld/ELF/Writer.cpp:2655
+
+  // If a link script is in use section order does not necessarily match
+  // segment order and segments can be at arbitrary addresses. To handle this
----------------
The comment is not on-topic. What we do here is to make interleaving segments work. See my question in the main comment.

link script -> linker script


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95199/new/

https://reviews.llvm.org/D95199



More information about the llvm-commits mailing list