This is an archive of the discontinued LLVM Phabricator instance.

[NFC][llvm-readobj] Split getSectionIndexName function into two
ClosedPublic

Authored by jhenderson on Oct 31 2019, 9:54 AM.

Details

Summary

getSectionIndexName was trying to fetch two things at once, which led to a somewhat tricky to understand interface involving passing output parameters in, and also made it hard to return Errors further up the stack.

This change is in preparation for changing the error handling.

Additionally, update a related test now that yaml2obj supports SHT_SYMTAB_SHNDX properly, and add missing LLVM-style coverage for symbols with shndx SHN_XINDEX. This test (after fixing) caught a mistake in my first attempt at this patch, hence I'm including it as part of this patch.

Depends on D69669.

Diff Detail

Event Timeline

jhenderson created this revision.Oct 31 2019, 9:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2019, 9:54 AM
MaskRay accepted this revision.Oct 31 2019, 10:29 AM
MaskRay added inline comments.
llvm/test/tools/llvm-readobj/elf-symbol-shndx.test
68–69

Nice cleanup after the yaml2obj change D65446.

This revision is now accepted and ready to land.Oct 31 2019, 10:29 AM
grimar accepted this revision.Nov 1 2019, 1:30 AM

LGTM with a nit.

llvm/tools/llvm-readobj/ELFDumper.cpp
7024

Seems you should be able to typename ELFT::Shdr -> Elf_Shdr here?

This revision was automatically updated to reflect the committed changes.