This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] - Stop reporting bogus section IDs.
ClosedPublic

Authored by grimar on Jul 16 2018, 6:46 AM.

Details

Summary

Imagine we have a file with few sections, and one of them is .foo
with index N != 0.

Problem is that when llvm-objdump is given a -section=.foo parameter
it lists .foo as a section at index 0. That makes impossible to write
test cases which needs to find the index of the particular section,
while ignoring dumping of others.

The patch fixes that.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jul 16 2018, 6:46 AM
grimar added a subscriber: ikudrin.
jhenderson accepted this revision.Jul 17 2018, 1:58 AM

LGTM, with a couple of minor improvements to the test.

test/tools/llvm-objdump/X86/section-index.s
9 ↗(On Diff #155666)

I'd update the comment to explicitly mention "when requesting a specific section".

13 ↗(On Diff #155666)

Maybe you might want to check that no other sections are printed?

This revision is now accepted and ready to land.Jul 17 2018, 1:58 AM
This revision was automatically updated to reflect the committed changes.