70 lines · plain
1## ELF section symbols use the corresponding section names when printing2## unnamed symbols. This test verifies this and also that appropriate things3## are printed if the section is somehow invalid.4 5# RUN: yaml2obj %s -o %t16# RUN: llvm-objdump -r --syms %t1 2>&1 | \7# RUN: FileCheck %s -DFILE=%t1 --implicit-check-not=warning:8 9# CHECK: SYMBOL TABLE:10# CHECK-NEXT: 00000000 l d .foo 00000000 .foo11# CHECK-NEXT: 00000000 l d .foo 00000000 .foo12# CHECK-NEXT: warning: '[[FILE]]': invalid section index: 6713# CHECK-NEXT: warning: '[[FILE]]': invalid section index: 6814 15# CHECK: RELOCATION RECORDS FOR [.foo]:16# CHECK-NEXT: OFFSET TYPE VALUE17# CHECK-NEXT: 00000001 R_X86_64_NONE .foo18# CHECK-NEXT: 00000002 R_X86_64_NONE .foo19# CHECK-NEXT: 00000003 R_X86_64_NONE {{$}}20# CHECK-NEXT: 00000004 R_X86_64_NONE {{$}}21 22## Test that we consume an error in ELFObjectFile<ELFT>::getSectionName when disassembling. 23# RUN: %if x86-registered-target %{ llvm-objdump -d --syms %t1 2>&1 | \24# RUN: FileCheck %s -DFILE=%t1 --check-prefix=CHECK-DISAS %}25# CHECK-DISAS: warning: '[[FILE]]': invalid section index: 6726 27--- !ELF28FileHeader:29 Class: ELFCLASS3230 Data: ELFDATA2LSB31 Type: ET_REL32 Machine: EM_X86_6433Sections:34 - Name: .foo35 Type: SHT_PROGBITS36 - Name: .rela.foo37 Type: SHT_RELA38 Link: .symtab39 Info: .foo40 Relocations:41 - Offset: 0x142 Symbol: 143 Type: R_X86_64_NONE44 - Offset: 0x245 Symbol: 246 Type: R_X86_64_NONE47 - Offset: 0x348 Symbol: 349 Type: R_X86_64_NONE50 - Offset: 0x451 Symbol: 452 Type: R_X86_64_NONE53Symbols:54## Case 1: a valid unnamed section symbol.55 - Name: ""56 Section: .foo57 Type: STT_SECTION58## Case 2: a valid named section symbol.59 - Name: "symbol1"60 Section: .foo61 Type: STT_SECTION62## Case 3: an unnamed section symbol with invalid index.63 - Name: ""64 Index: 0x4365 Type: STT_SECTION66## Case 4: a named section symbol with invalid index.67 - Name: "symbol2"68 Index: 0x4469 Type: STT_SECTION70