[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
Mon Dec 3 00:49:34 PST 2018


grimar added a comment.

In D54621#1314451 <https://reviews.llvm.org/D54621#1314451>, @peter.smith wrote:

> This could also occur with ALIGNOF and SIZEOF. It looks like Script->getOrCreateSectionName() is only called when a part of a script references another, whereas SECTIONS uses Script->createSectionName(). Might it be better to set ForceKeepIfEmpty in that function.


Note, I have `SIZEOF` in the test.

I tried to isolate and minimize the effect, so to keep the empty section only when/if it is really needed.
`ALIGNOF` and `SIZEOF` would return 0 for an empty removed section, that seems to be OK just to ignore them.


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

https://reviews.llvm.org/D54621





More information about the llvm-commits mailing list