[PATCH] D54621: [ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 30 01:08:24 PST 2018


grimar added a comment.

+Peter, interesting to know his opinion about how much useful this one might be (or not) is for embedded soft.

We already don't remove an empty section if its expression contains symbols. It seems consistent step to keep the referenced sections as well ten.
We do produce a broken output here now. Personally, I am not a user of tricky linker script features, but I think I am observing such constructions like
` AT(ADDR (.section_name) + 0xABC)` often in scripts in the wild. There is a difference in how do we handle the empty sections in LLD with what bfd do.
Some differences probably will never be fixed, but some can be fixed easily. I do not understand why we would want to leave the situation (fixed by this patch) "as is" when we:

1. Already spent some time on fixing the others different cases relative to empty sections to improve consistency with the bfd.
2. Silently produce a broken output now and reporting the error would be more complicated than actual fix perhaps.
3. Have a user who faced and reported the issue (and an unknown number of people who did not yet) and a patch that is trivial and consistent with the overall LLD story about empty sections.


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

https://reviews.llvm.org/D54621





More information about the llvm-commits mailing list