[PATCH] D50688: [LLD] Warn if non-alloc sections occur before alloc sections in linker scripts

Konstantin Schwarz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 04:54:04 PDT 2018


kschwarz added a comment.

Thanks for the link! However, I'm not sure if this is really related. The issue there was that a non-alloc section should be placed into a program header explicitly via PHDRS commands, which might be a valid use case.

In "automatic" program header creation, a non-alloc section will never appear in a program header, but unfortunately the header creation, orphan placement and address assignment all rely on the strict separation of alloc and non-alloc sections and will produce a broken ELF for mixed sections.

Since non-alloc sections can only be put under a program header via PHDRS commands, I think issuing a warning if no PHDRS commands are given and alloc/non-alloc sections are mixed and not touching the rest of the code should be okay.
What do you think?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50688





More information about the llvm-commits mailing list