This is an archive of the discontinued LLVM Phabricator instance.

[yaml2obj]Lookup relocation symbols in dynamic symbol when .dynsym referenced
AbandonedPublic

Authored by jhenderson on Mar 7 2019, 8:58 AM.

Details

Reviewers
grimar
Summary

This fixes https://bugs.llvm.org/show_bug.cgi?id=40337. Previously, it was always assumed that relocations referenced symbols in the static symbol table. Now, if the Link field references a section called ".dynsym" it will look up these symbols in the dynamic symbol table.

Diff Detail

Repository
rL LLVM

Event Timeline

jhenderson created this revision.Mar 7 2019, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2019, 8:58 AM
grimar accepted this revision.Mar 11 2019, 1:12 AM

LGTM.

tools/yaml2obj/yaml2elf.cpp
868

This place looks a bit overcomplicated (seems requires refactoring), but it is not a problem of this patch.

This revision is now accepted and ready to land.Mar 11 2019, 1:12 AM
jhenderson planned changes to this revision.Mar 11 2019, 4:01 AM

I forgot to run all the test before putting this patch up for review, and llvm-readobj/demangle.test is failing in a non-trivial way, which I'll need to fix. It may result in a different change in yaml2obj going in first, to fix segment offsets that contain .dynstr and .dynsym based on my first look.

grimar added inline comments.Mar 11 2019, 9:09 AM
tools/yaml2obj/yaml2elf.cpp
868

I committed NFC in r355832. Open for comments.

jhenderson marked an inline comment as done.Mar 11 2019, 9:56 AM
jhenderson added inline comments.
tools/yaml2obj/yaml2elf.cpp
868

Seems reasonable. I'll rebase later, once I've fixed up the other issue. I've got some higher priority work to do first, so this may have to go onto the backburner for a week or two.

jhenderson abandoned this revision.Aug 22 2019, 3:41 AM

Abandoned in favour of D66532.