2019-05-23 14:30:39 +02:00
|
|
|
## Show the disassembly behaviour when dynamic symbols are present.
|
|
|
|
# RUN: yaml2obj %s -o %t
|
|
|
|
|
|
|
|
## Case 1: Both static and dynamic symbols are present. Only static
|
|
|
|
## symbols are displayed.
|
|
|
|
# RUN: llvm-objdump -d %t | FileCheck %s --check-prefixes=CHECK,STATIC
|
|
|
|
|
|
|
|
## Case 2: Only the dynamic symbols are present. These should be displayed, if
|
|
|
|
## they meet the necessary criteria.
|
|
|
|
# RUN: llvm-objcopy --strip-all %t %t2
|
|
|
|
# RUN: llvm-objdump -d %t2 | FileCheck %s --check-prefixes=CHECK,DYN
|
|
|
|
|
|
|
|
# CHECK: Disassembly of section .text:
|
|
|
|
# CHECK-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# STATIC-NEXT: 0000000000001000 <.text>:
|
|
|
|
# DYN-NEXT: 0000000000001000 <only_dyn>:
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NEXT: 1000:
|
|
|
|
# CHECK-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# STATIC-NEXT: 0000000000001001 <both_static>:
|
|
|
|
# DYN-NEXT: 0000000000001001 <both_dyn>:
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NEXT: 1001:
|
|
|
|
# STATIC-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# STATIC-NEXT: 0000000000001002 <only_static>:
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NEXT: 1002:
|
2019-06-24 19:47:56 +02:00
|
|
|
# DYN-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# DYN-NEXT: 0000000000001003 <object>:
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NEXT: 1003:
|
2019-06-24 19:47:56 +02:00
|
|
|
# DYN-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# DYN-NEXT: 0000000000001004 <zero_sized>:
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NEXT: 1004:
|
2019-06-24 19:47:56 +02:00
|
|
|
# DYN-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# DYN-NEXT: 0000000000001005 <common>:
|
2019-06-24 19:47:56 +02:00
|
|
|
# CHECK-NEXT: 1005:
|
|
|
|
# DYN-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# DYN-NEXT: 0000000000001006 <loos>:
|
2019-06-24 19:47:56 +02:00
|
|
|
# CHECK-NEXT: 1006:
|
|
|
|
# DYN-EMPTY:
|
2020-03-05 23:18:38 +01:00
|
|
|
# DYN-NEXT: 0000000000001007 <loproc>:
|
2019-06-24 19:47:56 +02:00
|
|
|
# CHECK-NEXT: 1007:
|
|
|
|
# CHECK-NEXT: 1008:
|
|
|
|
# CHECK-NEXT: 1009:
|
|
|
|
# CHECK-NEXT: 100a:
|
|
|
|
# CHECK-NEXT: 100b:{{.*}}
|
2019-05-23 14:30:39 +02:00
|
|
|
# CHECK-NOT: {{.}}
|
|
|
|
|
|
|
|
--- !ELF
|
|
|
|
FileHeader:
|
|
|
|
Class: ELFCLASS64
|
|
|
|
Data: ELFDATA2LSB
|
|
|
|
Type: ET_DYN
|
|
|
|
Machine: EM_X86_64
|
|
|
|
Sections:
|
|
|
|
- Name: .text
|
|
|
|
Type: SHT_PROGBITS
|
|
|
|
Flags: [SHF_ALLOC, SHF_EXECINSTR]
|
|
|
|
Address: 0x1000
|
2019-06-24 19:47:56 +02:00
|
|
|
Content: 909090909090909090909090
|
2019-05-23 14:30:39 +02:00
|
|
|
ProgramHeaders:
|
2020-10-30 13:54:03 +01:00
|
|
|
- Type: PT_LOAD
|
|
|
|
VAddr: 0x1000
|
|
|
|
FirstSec: .text
|
|
|
|
LastSec: .text
|
2019-05-23 14:30:39 +02:00
|
|
|
Symbols:
|
|
|
|
- Name: both_static
|
|
|
|
Value: 0x1001
|
|
|
|
Section: .text
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: only_static
|
|
|
|
Value: 0x1002
|
|
|
|
Section: .text
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
DynamicSymbols:
|
|
|
|
- Name: only_dyn
|
|
|
|
Value: 0x1000
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
|
|
|
Type: STT_FUNC
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: both_dyn
|
|
|
|
Value: 0x1001
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
2019-06-24 19:47:56 +02:00
|
|
|
Type: STT_NOTYPE
|
2019-05-23 14:30:39 +02:00
|
|
|
Binding: STB_GLOBAL
|
2019-06-24 19:47:56 +02:00
|
|
|
- Name: object
|
2019-05-23 14:30:39 +02:00
|
|
|
Value: 0x1003
|
|
|
|
Section: .text
|
2019-06-24 19:47:56 +02:00
|
|
|
Size: 1
|
2019-05-23 14:30:39 +02:00
|
|
|
Type: STT_OBJECT
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: zero_sized
|
|
|
|
Value: 0x1004
|
|
|
|
Section: .text
|
|
|
|
Type: STT_FUNC
|
|
|
|
Binding: STB_GLOBAL
|
2019-06-24 19:47:56 +02:00
|
|
|
- Name: common
|
2019-05-23 14:30:39 +02:00
|
|
|
Value: 0x1005
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
2019-06-24 19:47:56 +02:00
|
|
|
Type: STT_COMMON
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: loos
|
|
|
|
Value: 0x1006
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
|
|
|
Type: 10
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: loproc
|
|
|
|
Value: 0x1007
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
|
|
|
Type: 13
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
## The rest of the dynamic symbols won't be used for various reasons.
|
|
|
|
- Name: section
|
|
|
|
Value: 0x1008
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
|
|
|
Type: STT_SECTION
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: '' # No name
|
|
|
|
Value: 0x1009
|
|
|
|
Section: .text
|
|
|
|
Size: 1
|
2019-05-23 14:30:39 +02:00
|
|
|
Type: STT_FUNC
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: absolute
|
2019-06-24 19:47:56 +02:00
|
|
|
Value: 0x100a
|
2019-05-23 14:30:39 +02:00
|
|
|
Index: SHN_ABS
|
|
|
|
Size: 1
|
|
|
|
Type: STT_FUNC
|
|
|
|
Binding: STB_GLOBAL
|
|
|
|
- Name: undefined
|
2019-06-24 19:47:56 +02:00
|
|
|
Value: 0x100b
|
2019-05-23 14:30:39 +02:00
|
|
|
Index: SHN_UNDEF
|
|
|
|
Size: 1
|
|
|
|
Type: STT_FUNC
|
|
|
|
Binding: STB_GLOBAL
|