This is an archive of the discontinued LLVM Phabricator instance.

[obj2yaml] - Support dumping objects that have multiple SHT_SYMTAB_SHNDX sections.
ClosedPublic

Authored by grimar on Dec 4 2020, 2:32 AM.

Details

Summary

It is allowed to have multiple SHT_SYMTAB_SHNDX sections, though
we currently don't implement it.

The current implementation assumes that there is a maximum of one SHT_SYMTAB_SHNDX
section and that it is always linked with .symtab section.

This patch drops this limitations.

Diff Detail

Event Timeline

grimar created this revision.Dec 4 2020, 2:32 AM
grimar requested review of this revision.Dec 4 2020, 2:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 2:32 AM

I actually filed a bug about this a while back: https://bugs.llvm.org/show_bug.cgi?id=43991

llvm/tools/obj2yaml/elf2yaml.cpp
318

It might be worth a comment why this is a cantFail, since it seems quite possible sh_link could be invalid.

326

Is not_supported correct here? I'm asuming the error is when the data isn't a valid getSHNDXTable which sounds more like parse_failed or illegal_argument.

grimar added a comment.Dec 7 2020, 2:03 AM

I actually filed a bug about this a while back: https://bugs.llvm.org/show_bug.cgi?id=43991

Yeah, I know. But it is about llvm-readelf, this patch is for obj2yaml, though the issue is indeed the same.
I am investigating that bug, btw, too.

I actually filed a bug about this a while back: https://bugs.llvm.org/show_bug.cgi?id=43991

Yeah, I know. But it is about llvm-readelf, this patch is for obj2yaml, though the issue is indeed the same.
I am investigating that bug, btw, too.

Oops, I misread, thanks.

grimar updated this revision to Diff 309850.Dec 7 2020, 2:42 AM
grimar marked 2 inline comments as done.
  • Addressed review comments.
llvm/tools/obj2yaml/elf2yaml.cpp
326

Right. Done.

This revision is now accepted and ready to land.Dec 8 2020, 12:39 AM