59 lines · plain
1# Show that llvm-readobj can print symbol bindings correctly for both LLVM and2# GNU styles, including for symbol bindings that are not recognised.3 4# RUN: yaml2obj %s -o %t5# RUN: llvm-readobj --symbols --dyn-symbols %t | FileCheck %s --check-prefix=LLVM6# RUN: llvm-readelf --symbols --dyn-symbols %t | FileCheck %s --check-prefix=GNU7 8# LLVM: Name: local9# LLVM: Binding: Local10# LLVM: Name: global11# LLVM: Binding: Global12# LLVM: Name: weak13# LLVM: Binding: Weak14# LLVM: Name: unknown15# LLVM: Binding: 0x316# LLVM: Name: unique17# LLVM: Binding: Unique (0xA)18# LLVM: Name: os19# LLVM: Binding: 0xB20# LLVM: Name: proc21# LLVM: Binding: 0xF22 23# GNU: 3 {{.*}} unknown24# GNU-NEXT: UNIQUE {{.*}} unique25# GNU-NEXT: b {{.*}} os26# GNU-NEXT: f {{.*}} proc27# GNU: LOCAL {{.*}} local28# GNU-NEXT: GLOBAL {{.*}} global29# GNU-NEXT: WEAK {{.*}} weak30 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--- !ELF34FileHeader:35 Class: ELFCLASS3236 Data: ELFDATA2LSB37 Type: ET_REL38Sections:39 - Name: .dynstr40 Type: SHT_STRTAB41 #\0unknown\0unique\0os\0proc\042 Content: "00756e6b6e6f776e00756e69717565006f730070726f6300"43 - Name: .dynsym44 Type: SHT_DYNSYM45 Link: .dynstr46 EntSize: 1647 # Null symbol48 # Symbol with st_name = 1, binding = 0x349 # Symbol with st_name = 9, binding = 0xa50 # Symbol with st_name = 16, binding = 0xb51 # Symbol with st_name = 19, binding = 0xf52 Content: "0000000000000000000000000000000001000000000000000000000030000000090000000000000000000000a0000000100000000000000000000000b0000000130000000000000000000000f0000000"53Symbols:54 - Name: local55 - Name: global56 Binding: STB_GLOBAL57 - Name: weak58 Binding: STB_WEAK59