readelf-s-alias.test 1.51 KB
# In llvm-readobj, -s is an alias for --sections.
RUN: llvm-readobj -S %p/Inputs/trivial.obj.elf-i386 \
RUN:   | FileCheck %s -check-prefix SEC
RUN: llvm-readobj --sections %p/Inputs/trivial.obj.elf-i386 \
RUN:   | FileCheck %s -check-prefix SEC

# In llvm-readelf, -s is an alias for --symbols.
RUN: llvm-readelf -s %p/Inputs/trivial.obj.elf-i386 \
RUN:   | FileCheck %s -check-prefix SYM
RUN: llvm-readelf --symbols %p/Inputs/trivial.obj.elf-i386 \
RUN:   | FileCheck %s -check-prefix SYM

SEC:      Sections [
SEC-NEXT:   Section {
SEC-NEXT:     Index: 0
SEC-NEXT:     Name:  (0)
SEC-NEXT:     Type: SHT_NULL (0x0)
SEC-NEXT:     Flags [ (0x0)
SEC-NEXT:     ]
SEC-NEXT:     Address: 0x0
SEC-NEXT:     Offset: 0x0
SEC-NEXT:     Size: 0
SEC-NEXT:     Link: 0
SEC-NEXT:     Info: 0
SEC-NEXT:     AddressAlignment: 0
SEC-NEXT:     EntrySize: 0
SEC-NEXT:   }
SEC-NEXT:   Section {
SEC-NEXT:     Index: 1
SEC-NEXT:     Name: .text (5)
SEC-NEXT:     Type: SHT_PROGBITS (0x1)
SEC-NEXT:     Flags [ (0x6)
SEC-NEXT:       SHF_ALLOC (0x2)
SEC-NEXT:       SHF_EXECINSTR (0x4)
SEC-NEXT:     ]
SEC-NEXT:     Address: 0x0
SEC-NEXT:     Offset: 0x40
SEC-NEXT:     Size: 42
SEC-NEXT:     Link: 0
SEC-NEXT:     Info: 0
SEC-NEXT:     AddressAlignment: 16
SEC-NEXT:     EntrySize: 0
SEC-NEXT:   }

SYM:      Symbol table '.symtab' contains {{.*}} entries:
SYM-NEXT:    Num:    Value  Size Type    Bind   Vis      Ndx Name
SYM-NEXT:      0: {{.*}} NOTYPE  {{.*}} UND
SYM-NEXT:      1: {{.*}} FILE    {{.*}} trivial.ll
SYM-NEXT:      2: {{.*}} OBJECT  {{.*}} .L.str