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

Patrick Oppenlander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 23 00:28:46 PST 2021


pattop added a comment.

In D95199#2517071 <https://reviews.llvm.org/D95199#2517071>, @MaskRay wrote:

> In D95199#2514581 <https://reviews.llvm.org/D95199#2514581>, @pattop wrote:
>
>> In fact, if https://reviews.llvm.org/D95198 is acceptable it is a separate justification for this change. In order to place program headers somewhere other than the lowest VMA in the program image something like this needs to happen.
>
> Both this patch and D95198 <https://reviews.llvm.org/D95198> look a bit arbitrary to me. Please see my question in D95198 <https://reviews.llvm.org/D95198>. Also adding @grimar who has improved linker scripts a lot.

I don't agree that these are arbitrary issues.

I proposed this and D95198 <https://reviews.llvm.org/D95198> as I encountered these issues in the real world while porting projects which have been working with GNU ld for many years.

Sure, this one can be worked around by reordering the link script, but it's certainly confusing for a user coming from GNU ld. Especially as the error message (pertaining to file range) does not really point to the underlying problem.

It was very surprising to me that LLD requires sections in a link script to be in a special order.


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