[PATCH] D44012: [ELF] - Allow discarding .hash and .gnu.hash from linker script.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 5 10:44:03 PST 2018


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: ELF/LinkerScript.cpp:363-364
 
+    // It's normal to discard the following sections. We drop the pointer to adjust
+    // the rest code behavior as there were no such sections from the begining.
+    if (S == InX::GnuHashTab)
----------------
grimar wrote:
> ruiu wrote:
> > Is that actually common? Could you give me an example?
> I am not saying it is common (I am fixing crash here first of all), but there is nothing wrong with that either.
> We could disallow discarding of them instead probably, but there are no solid reasons for doing that I think,
> as it would be an artificial limitation inconsistent with gnu linkers (they allow doing that).
"normal" sounded like it was somewhat common. Maybe I'd say "You can discard .hash and .gnu.hash sections by linker scripts. Since they are synthesized sections, we need to handle them differently than other regular sections."


https://reviews.llvm.org/D44012





More information about the llvm-commits mailing list