brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 6303f60 Raw
60 lines · plain
1# RUN: yaml2obj --docnum=1 %s -o %t1.o2# RUN: llvm-nm %t1.o --format=sysv | FileCheck %s3 4--- !ELF5FileHeader:6  Class:   ELFCLASS647  Data:    ELFDATA2LSB8  Type:    ET_REL9  Machine: EM_X86_6410Sections:11  - Name:  .text12    Type:  SHT_PROGBITS13    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]14Symbols:15  - Name:    symbol_undefined16  - Name:    symbol17    Section: .text18  - Name:    symbol_common19    Index:   SHN_COMMON20  - Name:    symbol_absolute21    Index:   SHN_ABS22  - Name:    proc23    Index:   0xff0124  - Name:    os25    Index:   0xff2126  - Name:    reserved27    Index:   0xfffe28 29# CHECK:      os               {{.*}}|30# CHECK-NEXT: proc             {{.*}}|31# CHECK-NEXT: reserved         {{.*}}|32# CHECK-NEXT: symbol           {{.*}}|     |.text33# CHECK-NEXT: symbol_absolute  {{.*}}|     |*ABS*34# CHECK-NEXT: symbol_common    {{.*}}|     |*COM*35# CHECK-NEXT: symbol_undefined {{.*}}|     |*UND*36 37## Here we have a symbol that belongs to a section with a broken name38## (sh_name offset goes past the end of the sections name string table).39## We test that we can still print a reasonable output and don't crash/assert.40 41# RUN: yaml2obj --docnum=2 %s -o %t2.o42# RUN: llvm-nm %t2.o --format=sysv | FileCheck %s --check-prefix=ERR43 44# ERR: foo |0000000000000000| ? | NOTYPE|0000000000000000| |45 46--- !ELF47FileHeader:48  Class:   ELFCLASS6449  Data:    ELFDATA2LSB50  Type:    ET_REL51  Machine: EM_X86_6452Sections:53  - Name:  .broken54    Type:  SHT_PROGBITS55    Flags: [ SHF_ALLOC, SHF_EXECINSTR ]56    ShName: 0xffff57Symbols:58  - Name:    foo59    Section: .broken60