[PATCH] D85100: [ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 09:29:28 PDT 2020


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: lld/ELF/Writer.cpp:1237
               std::vector<BaseCommand *>::iterator e) {
+  // To make the addresses of orphan sections not affected by orphan
+  // non-SHF_ALLOC sections in the middle, place orphan non-SHF_ALLOC sections
----------------
psmith wrote:
> I suggest rewording:
> ```
> // To make the addresses of orphan sections not affected by orphan
> // non-SHF_ALLOC sections in the middle, place orphan non-SHF_ALLOC sections
> // at the end.
> ```
> as
> ```
> // OutputSections without the SHF_ALLOC flag are not part of the memory image and
> // are given an address starting at 0. Place any orphan sections without the SHF_ALLOC
> // flag at the end so that these do not affect the address assignment of OutputSections
> // with the SHF_ALLOC flag.
> ```
Thanks. I reworded the part "are given an address starting at 0" as we actually assign addresses to OutputSections without the SHF_ALLOC flag created from non-orphan sections.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85100



More information about the llvm-commits mailing list