This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj][obj2yaml] - Support SHT_GNU_verdef ( .gnu.version_d) section.
ClosedPublic

Authored by grimar on Feb 20 2019, 3:41 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Feb 20 2019, 3:41 AM
jhenderson accepted this revision.Feb 20 2019, 6:57 AM

LGTM.

test/tools/obj2yaml/verdef-section.yaml
69–71 ↗(On Diff #187544)

Do you need this symbol?

test/tools/yaml2obj/verdef-section.yaml
66–68 ↗(On Diff #187544)

Ditto.

This revision is now accepted and ready to land.Feb 20 2019, 6:57 AM
grimar marked an inline comment as done.Feb 20 2019, 7:00 AM
grimar added inline comments.
test/tools/obj2yaml/verdef-section.yaml
69–71 ↗(On Diff #187544)

Yes, it triggers the creation of .dynsym and .dynstr. I need the latter.

jhenderson added inline comments.Feb 20 2019, 7:10 AM
test/tools/obj2yaml/verdef-section.yaml
69–71 ↗(On Diff #187544)

Okay. You could always create an explicit .dynstr section instead though. But this is fine.

grimar marked an inline comment as done.Feb 20 2019, 7:24 AM
grimar added inline comments.
test/tools/obj2yaml/verdef-section.yaml
69–71 ↗(On Diff #187544)

I wanted/tried to do in that way initially but found it is probably not very correct.
It does not seem we can have .gnu_version_d section without a .dynsym/.dynstr in
a normally created ELF.

For example, in LLD we might add .dynstr and all 3 versioning sections only when having a .dynsym.:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L338

Also, it would add slightly more code, so I refused from this idea because of all of that.

(For the purpose of creating invalid objects, that might be useful, probably, though, but I have no use case atm)

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2019, 4:21 AM