[llvm-objdump] - Stop reporting bogus section IDs.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 18 Jul 2018 08:34:35 +0000 (08:34 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 18 Jul 2018 08:34:35 +0000 (08:34 +0000)
commite35e6448f99d69c40f7073794abbd75b9a0a75c0
treeb5e7af5240f39dc506abaddd69224b296994f645
parent6fdac3b23ad9229c953a0cede9c01af6c5605792
[llvm-objdump] - Stop reporting bogus section IDs.

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.

Differential revision: https://reviews.llvm.org/D49372

llvm-svn: 337361
llvm/test/tools/llvm-objdump/X86/section-index.s [new file with mode: 0644]
llvm/tools/llvm-objdump/llvm-objdump.cpp