139 lines · plain
1## Show the disassembly behaviour when dynamic symbols are present.2# RUN: yaml2obj %s -o %t3 4## Case 1: Both static and dynamic symbols are present. Only static5## symbols are displayed.6# RUN: llvm-objdump -d %t | FileCheck %s --check-prefixes=CHECK,STATIC7 8## Case 2: Only the dynamic symbols are present. These should be displayed, if9## they meet the necessary criteria.10# RUN: llvm-objcopy --strip-all %t %t211# RUN: llvm-objdump -d %t2 | FileCheck %s --check-prefixes=CHECK,DYN12 13# CHECK: Disassembly of section .text:14# CHECK-EMPTY:15# STATIC-NEXT: 0000000000001000 <.text>:16# DYN-NEXT: 0000000000001000 <only_dyn>:17# CHECK-NEXT: 1000:18# CHECK-EMPTY:19# STATIC-NEXT: 0000000000001001 <both_static>:20# DYN-NEXT: 0000000000001001 <both_dyn>:21# CHECK-NEXT: 1001:22# STATIC-EMPTY:23# STATIC-NEXT: 0000000000001002 <only_static>:24# CHECK-NEXT: 1002:25# DYN-EMPTY:26# DYN-NEXT: 0000000000001003 <object>:27# CHECK-NEXT: 1003:28# DYN-EMPTY:29# DYN-NEXT: 0000000000001004 <zero_sized>:30# CHECK-NEXT: 1004:31# DYN-EMPTY:32# DYN-NEXT: 0000000000001005 <common>:33# CHECK-NEXT: 1005:34# DYN-EMPTY:35# DYN-NEXT: 0000000000001006 <loos>:36# CHECK-NEXT: 1006:37# DYN-EMPTY:38# DYN-NEXT: 0000000000001007 <loproc>:39# CHECK-NEXT: 1007:40# CHECK-NEXT: 1008:41# CHECK-NEXT: 1009:42# CHECK-NEXT: 100a:43# CHECK-NEXT: 100b:{{.*}}44# CHECK-NOT: {{.}}45 46--- !ELF47FileHeader:48 Class: ELFCLASS6449 Data: ELFDATA2LSB50 Type: ET_DYN51 Machine: EM_X86_6452Sections:53 - Name: .text54 Type: SHT_PROGBITS55 Flags: [SHF_ALLOC, SHF_EXECINSTR]56 Address: 0x100057 Content: 90909090909090909090909058ProgramHeaders:59 - Type: PT_LOAD60 VAddr: 0x100061 FirstSec: .text62 LastSec: .text63Symbols:64 - Name: both_static65 Value: 0x100166 Section: .text67 Binding: STB_GLOBAL68 - Name: only_static69 Value: 0x100270 Section: .text71 Binding: STB_GLOBAL72DynamicSymbols:73 - Name: only_dyn74 Value: 0x100075 Section: .text76 Size: 177 Type: STT_FUNC78 Binding: STB_GLOBAL79 - Name: both_dyn80 Value: 0x100181 Section: .text82 Size: 183 Type: STT_NOTYPE84 Binding: STB_GLOBAL85 - Name: object86 Value: 0x100387 Section: .text88 Size: 189 Type: STT_OBJECT90 Binding: STB_GLOBAL91 - Name: zero_sized92 Value: 0x100493 Section: .text94 Type: STT_FUNC95 Binding: STB_GLOBAL96 - Name: common97 Value: 0x100598 Section: .text99 Size: 1100 Type: STT_COMMON101 Binding: STB_GLOBAL102 - Name: loos103 Value: 0x1006104 Section: .text105 Size: 1106 Type: 10107 Binding: STB_GLOBAL108 - Name: loproc109 Value: 0x1007110 Section: .text111 Size: 1112 Type: 13113 Binding: STB_GLOBAL114 ## The rest of the dynamic symbols won't be used for various reasons.115 - Name: section116 Value: 0x1008117 Section: .text118 Size: 1119 Type: STT_SECTION120 Binding: STB_GLOBAL121 - Name: '' # No name122 Value: 0x1009123 Section: .text124 Size: 1125 Type: STT_FUNC126 Binding: STB_GLOBAL127 - Name: absolute128 Value: 0x100a129 Index: SHN_ABS130 Size: 1131 Type: STT_FUNC132 Binding: STB_GLOBAL133 - Name: undefined134 Value: 0x100b135 Index: SHN_UNDEF136 Size: 1137 Type: STT_FUNC138 Binding: STB_GLOBAL139