Index: llvm/test/tools/llvm-readobj/ELF/sec-compressed.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/sec-compressed.test +++ /dev/null @@ -1,9 +0,0 @@ -RUN: llvm-readobj --sections \ -RUN: %p/Inputs/compression.zlib.style.elf-x86-64 | FileCheck %s - -CHECK: Section { -CHECK: Name: .debug_info -CHECK-NEXT: Type: SHT_PROGBITS -CHECK-NEXT: Flags [ -CHECK-NEXT: SHF_COMPRESSED (0x800) -CHECK-NEXT: ] Index: llvm/test/tools/llvm-readobj/ELF/sec-flags.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/sec-flags.test +++ /dev/null @@ -1,67 +0,0 @@ -# Check that llvm-readobj shows arch specific ELF section flags. - -# RUN: yaml2obj -docnum 1 %s > %t-hex.o -# RUN: llvm-readobj -S %t-hex.o | FileCheck -check-prefix=HEX %s - -# HEX: Flags [ (0x10000000) -# HEX-NEXT: SHF_HEX_GPREL (0x10000000) -# HEX-NEXT: ] - -# hex.o ---- !ELF -FileHeader: - Class: ELFCLASS32 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_HEXAGON - Flags: [] -Sections: - - Name: .hex - Type: SHT_PROGBITS - Flags: [SHF_HEX_GPREL] - Size: 4 - -# RUN: yaml2obj -docnum 2 %s > %t-mips.o -# RUN: llvm-readobj -S %t-mips.o | FileCheck -check-prefix=MIPS %s - -# MIPS: Flags [ (0x38000000) -# MIPS-NEXT: SHF_MIPS_GPREL (0x10000000) -# MIPS-NEXT: SHF_MIPS_MERGE (0x20000000) -# MIPS-NEXT: SHF_MIPS_NOSTRIP (0x8000000) -# MIPS-NEXT: ] - -# mips.o ---- !ELF -FileHeader: - Class: ELFCLASS32 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_MIPS - Flags: [] -Sections: - - Name: .mips - Type: SHT_PROGBITS - Flags: [SHF_MIPS_GPREL, SHF_MIPS_MERGE, SHF_MIPS_NOSTRIP] - Size: 4 - -# RUN: yaml2obj -docnum 3 %s > %t-x86_64.o -# RUN: llvm-readobj -S %t-x86_64.o | FileCheck -check-prefix=X86_64 %s - -# X86_64: Flags [ (0x10000000) -# X86_64-NEXT: SHF_X86_64_LARGE (0x10000000) -# X86_64-NEXT: ] - -# x86_64.o ---- !ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_X86_64 - Flags: [] -Sections: - - Name: .x86_64 - Type: SHT_PROGBITS - Flags: [SHF_X86_64_LARGE] - Size: 4 -... Index: llvm/test/tools/llvm-readobj/ELF/section-arch-flags.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-readobj/ELF/section-arch-flags.test @@ -0,0 +1,76 @@ +## Check how we dump arch specific ELF section flags. + +# RUN: yaml2obj -docnum 1 %s > %t-hex.o +# RUN: llvm-readobj -S %t-hex.o | FileCheck -check-prefix=HEX-LLVM %s +# RUN: llvm-readelf -S %t-hex.o | FileCheck -check-prefix=HEX-GNU %s + +# HEX-LLVM: Flags [ (0x10000000) +# HEX-LLVM-NEXT: SHF_HEX_GPREL (0x10000000) +# HEX-LLVM-NEXT: ] + +# HEX-GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al +# HEX-GNU: [ 1] .hex PROGBITS 00000000 000034 000004 00 p 0 0 0 + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_HEXAGON + Flags: [] +Sections: + - Name: .hex + Type: SHT_PROGBITS + Flags: [SHF_HEX_GPREL] + Size: 4 + +# RUN: yaml2obj -docnum 2 %s > %t-mips.o +# RUN: llvm-readobj -S %t-mips.o | FileCheck -check-prefix=MIPS-LLVM %s +# RUN: llvm-readelf -S %t-mips.o | FileCheck -check-prefix=MIPS-GNU %s + +# MIPS-GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al +# MIPS-GNU: [ 1] .mips PROGBITS 00000000 000034 000004 00 op 0 0 0 + +# MIPS-LLVM: Flags [ (0x38000000) +# MIPS-LLVM-NEXT: SHF_MIPS_GPREL (0x10000000) +# MIPS-LLVM-NEXT: SHF_MIPS_MERGE (0x20000000) +# MIPS-LLVM-NEXT: SHF_MIPS_NOSTRIP (0x8000000) +# MIPS-LLVM-NEXT: ] + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_MIPS + Flags: [] +Sections: + - Name: .mips + Type: SHT_PROGBITS + Flags: [SHF_MIPS_GPREL, SHF_MIPS_MERGE, SHF_MIPS_NOSTRIP] + Size: 4 + +# RUN: yaml2obj -docnum 3 %s > %t-x86_64.o +# RUN: llvm-readobj -S %t-x86_64.o | FileCheck -check-prefix=X86_64-LLVM %s +# RUN: llvm-readelf -S %t-x86_64.o | FileCheck -check-prefix=X86_64-GNU %s + +# X86_64-LLVM: Flags [ (0x10000000) +# X86_64-LLVM-NEXT: SHF_X86_64_LARGE (0x10000000) +# X86_64-LLVM-NEXT: ] + +# X86_64-GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al +# X86_64-GNU: [ 1] .x86_64 PROGBITS 0000000000000000 000040 000004 00 p 0 0 0 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 + Flags: [] +Sections: + - Name: .x86_64 + Type: SHT_PROGBITS + Flags: [SHF_X86_64_LARGE] + Size: 4 +... Index: llvm/test/tools/llvm-readobj/ELF/section-flags.test =================================================================== --- /dev/null +++ llvm/test/tools/llvm-readobj/ELF/section-flags.test @@ -0,0 +1,48 @@ +## Check how we dump regular ELF section flags. + +# RUN: yaml2obj %s > %t.o +# RUN: llvm-readobj -S %t.o | FileCheck -check-prefix=LLVM %s +# RUN: llvm-readelf -S %t.o | FileCheck -check-prefix=GNU %s + +# LLVM: Name: allflags +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x80000FF7) +# LLVM-NEXT: SHF_ALLOC (0x2) +# LLVM-NEXT: SHF_COMPRESSED (0x800) +# LLVM-NEXT: SHF_EXCLUDE (0x80000000) +# LLVM-NEXT: SHF_EXECINSTR (0x4) +# LLVM-NEXT: SHF_GROUP (0x200) +# LLVM-NEXT: SHF_INFO_LINK (0x40) +# LLVM-NEXT: SHF_LINK_ORDER (0x80) +# LLVM-NEXT: SHF_MERGE (0x10) +# LLVM-NEXT: SHF_OS_NONCONFORMING (0x100) +# LLVM-NEXT: SHF_STRINGS (0x20) +# LLVM-NEXT: SHF_TLS (0x400) +# LLVM-NEXT: SHF_WRITE (0x1) +# LLVM-NEXT: ] + +# LLVM: Name: noflags +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x0) +# LLVM-NEXT: ] + +# GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al +# GNU: [ 1] allflags PROGBITS 0000000000000000 000040 000000 00 WAEXMSILoGTx 0 0 0 +# GNU: [ 2] noflags PROGBITS 0000000000000000 000040 000000 00 0 0 0 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 + Flags: [] +Sections: + - Name: allflags + Type: SHT_PROGBITS + Flags: [SHF_WRITE, SHF_ALLOC, SHF_EXECINSTR, SHF_MERGE, + SHF_STRINGS, SHF_INFO_LINK, SHF_LINK_ORDER, SHF_OS_NONCONFORMING, + SHF_GROUP, SHF_TLS, SHF_COMPRESSED, SHF_EXCLUDE] + - Name: noflags + Type: SHT_PROGBITS + Flags: [ ]