llvm.org GIT mirror llvm / 6085833
[llvm-readelf] Correctly dump symbols whose section id is SHN_XINDEX Differential revision: https://reviews.llvm.org/D60614 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358396 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Leviant 6 months ago
2 changed file(s) with 28 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
0 # Tests that symbols whose section index is SHN_XINDEX are displayed
1 # correctly. They should not be treated as processor/OS specific or
2 # reserved.
3 # REQUIRES: x86-registered-target
4 # RUN: llvm-mc %s -filetype=obj -triple=x86_64-pc-linux -o %t
5 # RUN: llvm-readelf -s %t | FileCheck %s
6
7 .irp i, 0, 1, 2, 3, 4, 5, 6,
8 .irp j, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
9 .irp k, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10 .irp l, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
11 .irp q, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
12 .section sec_\i\j\k\l\q
13 .globl sym_\i\j\k\l\q
14 sym_\i\j\k\l\q:
15 .endr
16 .endr
17 .endr
18 .endr
19 .endr
20
21 # CHECK: 65278: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 65280 sym_65277
22 # CHECK: 65310: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 65312 sym_65309
23 # CHECK: 65342: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 65344 sym_65341
29602960 case ELF::SHN_COMMON:
29612961 return "COM";
29622962 case ELF::SHN_XINDEX:
2963 SectionIndex = unwrapOrError(object::getExtendedSymbolTableIndex(
2964 Symbol, FirstSym, this->dumper()->getShndxTable()));
2965 LLVM_FALLTHROUGH;
2963 return to_string(
2964 format_decimal(unwrapOrError(object::getExtendedSymbolTableIndex(
2965 Symbol, FirstSym, this->dumper()->getShndxTable())),
2966 3));
29662967 default:
29672968 // Find if:
29682969 // Processor specific