This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Allow discarding .hash and .gnu.hash from linker script.
ClosedPublic

Authored by grimar on Mar 2 2018, 6:45 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Mar 2 2018, 6:45 AM
ruiu added a comment.Mar 2 2018, 1:32 PM

Generally looking good, but ...

ELF/LinkerScript.cpp
363–364 ↗(On Diff #136739)

Is that actually common? Could you give me an example?

grimar added inline comments.Mar 5 2018, 1:11 AM
ELF/LinkerScript.cpp
363–364 ↗(On Diff #136739)

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).

ruiu accepted this revision.Mar 5 2018, 10:44 AM

LGTM

ELF/LinkerScript.cpp
363–364 ↗(On Diff #136739)

"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."

This revision is now accepted and ready to land.Mar 5 2018, 10:44 AM
This revision was automatically updated to reflect the committed changes.