llvm.org GIT mirror llvm / 9fab0fa
Merging r360439: ------------------------------------------------------------------------ r360439 | maskray | 2019-05-10 09:24:57 -0700 (Fri, 10 May 2019) | 8 lines [llvm-objdump] Print st_other Add support for ".hidden" ".internal" ".protected" and " 0x%02x" for other st_other bits used by some architectures. Reviewed By: sfertile Differential Revision: https://reviews.llvm.org/D61718 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_80@362668 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 months ago
2 changed file(s) with 63 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
0 # RUN: yaml2obj %s -o %t
1 # RUN: llvm-objdump --syms %t | FileCheck %s
2
3 # CHECK: SYMBOL TABLE:
4 # CHECK-NEXT: .text 00000000 default
5 # CHECK-NEXT: .text 00000000 .internal internal
6 # CHECK-NEXT: .text 00000000 .hidden hidden
7 # CHECK-NEXT: .text 00000000 .protected protected
8 # CHECK-NEXT: .text 00000000 0x20 mips_pic
9
10 !ELF
11 FileHeader:
12 Class: ELFCLASS32
13 Data: ELFDATA2LSB
14 Type: ET_REL
15 Machine: EM_MIPS
16 Flags: [ EF_MIPS_ABI_O32, EF_MIPS_ARCH_32 ]
17 Sections:
18 - Name: .text
19 Type: SHT_PROGBITS
20 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
21 Symbols:
22 Local:
23 - Name: default
24 Section: .text
25 - Name: internal
26 Visibility: STV_INTERNAL
27 Section: .text
28 - Name: hidden
29 Visibility: STV_HIDDEN
30 Section: .text
31 - Name: protected
32 Visibility: STV_PROTECTED
33 Section: .text
34 - Name: mips_pic
35 Other: [ STO_MIPS_PIC ]
36 Section: .text
20862086 outs() << SectionName;
20872087 }
20882088
2089 outs() << '\t';
20902089 if (Common || isa(O)) {
20912090 uint64_t Val =
20922091 Common ? Symbol.getAlignment() : ELFSymbolRef(Symbol).getSize();
2093 outs() << format("\t %08" PRIx64 " ", Val);
2094 }
2095
2096 if (Hidden)
2097 outs() << ".hidden ";
2092 outs() << format("\t%08" PRIx64, Val);
2093 }
2094
2095 if (isa(O)) {
2096 uint8_t Other = ELFSymbolRef(Symbol).getOther();
2097 switch (Other) {
2098 case ELF::STV_DEFAULT:
2099 break;
2100 case ELF::STV_INTERNAL:
2101 outs() << " .internal";
2102 break;
2103 case ELF::STV_HIDDEN:
2104 outs() << " .hidden";
2105 break;
2106 case ELF::STV_PROTECTED:
2107 outs() << " .protected";
2108 break;
2109 default:
2110 outs() << format(" 0x%02x", Other);
2111 break;
2112 }
2113 } else if (Hidden) {
2114 outs() << " .hidden";
2115 }
20982116
20992117 if (Demangle)
2100 outs() << demangle(Name) << '\n';
2118 outs() << ' ' << demangle(Name) << '\n';
21012119 else
2102 outs() << Name << '\n';
2120 outs() << ' ' << Name << '\n';
21032121 }
21042122 }
21052123