1# Show that llvm-readobj can print symbol bindings correctly for both LLVM and 2# GNU styles, including for symbol bindings that are not recognised. 3 4# RUN: yaml2obj %s -o %t 5# RUN: llvm-readobj --symbols --dyn-symbols %t | FileCheck %s --check-prefix=LLVM 6# RUN: llvm-readelf --symbols --dyn-symbols %t | FileCheck %s --check-prefix=GNU 7 8# LLVM: Name: local 9# LLVM: Binding: Local 10# LLVM: Name: global 11# LLVM: Binding: Global 12# LLVM: Name: weak 13# LLVM: Binding: Weak 14# LLVM: Name: unknown 15# LLVM: Binding: 0x3 16# LLVM: Name: unique 17# LLVM: Binding: Unique (0xA) 18# LLVM: Name: os 19# LLVM: Binding: 0xB 20# LLVM: Name: proc 21# LLVM: Binding: 0xF 22 23# GNU: 3 {{.*}} unknown 24# GNU-NEXT: UNIQUE {{.*}} unique 25# GNU-NEXT: b {{.*}} os 26# GNU-NEXT: f {{.*}} proc 27# GNU: LOCAL {{.*}} local 28# GNU-NEXT: GLOBAL {{.*}} global 29# GNU-NEXT: WEAK {{.*}} weak 30 31# yaml2obj doesn't have a way of specifying static symbols with custom bindings, 32# so use a custom dynamic symbol table section instead. 33--- !ELF 34FileHeader: 35 Class: ELFCLASS32 36 Data: ELFDATA2LSB 37 Type: ET_REL 38Sections: 39 - Name: .dynstr 40 Type: SHT_STRTAB 41 #\0unknown\0unique\0os\0proc\0 42 Content: "00756e6b6e6f776e00756e69717565006f730070726f6300" 43 - Name: .dynsym 44 Type: SHT_DYNSYM 45 Link: .dynstr 46 EntSize: 16 47 # Null symbol 48 # Symbol with st_name = 1, binding = 0x3 49 # Symbol with st_name = 9, binding = 0xa 50 # Symbol with st_name = 16, binding = 0xb 51 # Symbol with st_name = 19, binding = 0xf 52 Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000" 53Symbols: 54 - Name: local 55 - Name: global 56 Binding: STB_GLOBAL 57 - Name: weak 58 Binding: STB_WEAK 59