diff --git a/llvm/test/MC/ELF/exclude-debug-dwo.s b/llvm/test/MC/ELF/exclude-debug-dwo.s --- a/llvm/test/MC/ELF/exclude-debug-dwo.s +++ b/llvm/test/MC/ELF/exclude-debug-dwo.s @@ -5,7 +5,7 @@ # CHECK: .debug_info.dwo {{.*}} E # CHECK: .debug_types.dwo {{.*}} E # CHECK: .debug_abbrev.dwo {{.*}} E -# CHECK: .debug_str.dwo {{.*}} EMS +# CHECK: .debug_str.dwo {{.*}} MSE # CHECK: .debug_line.dwo {{.*}} E # CHECK: .debug_loc.dwo {{.*}} E # CHECK: .debug_str_offsets.dwo {{.*}} E diff --git a/llvm/test/tools/llvm-readobj/ELF/section-flags.test b/llvm/test/tools/llvm-readobj/ELF/section-flags.test --- a/llvm/test/tools/llvm-readobj/ELF/section-flags.test +++ b/llvm/test/tools/llvm-readobj/ELF/section-flags.test @@ -26,9 +26,93 @@ # 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 +# LLVM: Name: write +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x1) +# LLVM-NEXT: SHF_WRITE (0x1) +# LLVM-NEXT: ] + +# LLVM: Name: alloc +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x2) +# LLVM-NEXT: SHF_ALLOC (0x2) +# LLVM-NEXT: ] + +# LLVM: Name: exec +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x4) +# LLVM-NEXT: SHF_EXECINSTR (0x4) +# LLVM-NEXT: ] + +# LLVM: Name: merge +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x10) +# LLVM-NEXT: SHF_MERGE (0x10) +# LLVM-NEXT: ] + +# LLVM: Name: strings +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x20) +# LLVM-NEXT: SHF_STRINGS (0x20) +# LLVM-NEXT: ] + +# LLVM: Name: infolink +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x40) +# LLVM-NEXT: SHF_INFO_LINK (0x40) +# LLVM-NEXT: ] + +# LLVM: Name: linkorder +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x80) +# LLVM-NEXT: SHF_LINK_ORDER (0x80) +# LLVM-NEXT: ] + +# LLVM: Name: nonconforming +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x100) +# LLVM-NEXT: SHF_OS_NONCONFORMING (0x100) +# LLVM-NEXT: ] + +# LLVM: Name: group +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x200) +# LLVM-NEXT: SHF_GROUP (0x200) +# LLVM-NEXT: ] + +# LLVM: Name: tls +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x400) +# LLVM-NEXT: SHF_TLS (0x400) +# LLVM-NEXT: ] + +# LLVM: Name: compressed +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x800) +# LLVM-NEXT: SHF_COMPRESSED (0x800) +# LLVM-NEXT: ] + +# LLVM: Name: exclude +# LLVM-NEXT: Type: SHT_PROGBITS +# LLVM-NEXT: Flags [ (0x80000000) +# LLVM-NEXT: SHF_EXCLUDE (0x80000000) +# LLVM-NEXT: ] + +# GNU: [Nr] Name Type Address Off Size ES Flg Lk Inf Al +# GNU: [ 1] allflags PROGBITS 0000000000000000 000040 000000 00 WAXMSILOGTCE 0 0 0 +# GNU: [ 2] noflags PROGBITS 0000000000000000 000040 000000 00 0 0 0 +# GNU: [ 3] write PROGBITS 0000000000000000 000040 000000 00 W 0 0 0 +# GNU: [ 4] alloc PROGBITS 0000000000000000 000040 000000 00 A 0 0 0 +# GNU: [ 5] exec PROGBITS 0000000000000000 000040 000000 00 X 0 0 0 +# GNU: [ 6] merge PROGBITS 0000000000000000 000040 000000 00 M 0 0 0 +# GNU: [ 7] strings PROGBITS 0000000000000000 000040 000000 00 S 0 0 0 +# GNU: [ 8] infolink PROGBITS 0000000000000000 000040 000000 00 I 0 0 0 +# GNU: [ 9] linkorder PROGBITS 0000000000000000 000040 000000 00 L 0 0 0 +# GNU: [10] nonconforming PROGBITS 0000000000000000 000040 000000 00 O 0 0 0 +# GNU: [11] group PROGBITS 0000000000000000 000040 000000 00 G 0 0 0 +# GNU: [12] tls PROGBITS 0000000000000000 000040 000000 00 T 0 0 0 +# GNU: [13] compressed PROGBITS 0000000000000000 000040 000000 00 C 0 0 0 +# GNU: [14] exclude PROGBITS 0000000000000000 000040 000000 00 E 0 0 0 --- !ELF FileHeader: @@ -46,3 +130,39 @@ - Name: noflags Type: SHT_PROGBITS Flags: [ ] + - Name: write + Type: SHT_PROGBITS + Flags: [ SHF_WRITE ] + - Name: alloc + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC ] + - Name: exec + Type: SHT_PROGBITS + Flags: [ SHF_EXECINSTR ] + - Name: merge + Type: SHT_PROGBITS + Flags: [ SHF_MERGE ] + - Name: strings + Type: SHT_PROGBITS + Flags: [ SHF_STRINGS ] + - Name: infolink + Type: SHT_PROGBITS + Flags: [ SHF_INFO_LINK ] + - Name: linkorder + Type: SHT_PROGBITS + Flags: [ SHF_LINK_ORDER ] + - Name: nonconforming + Type: SHT_PROGBITS + Flags: [ SHF_OS_NONCONFORMING ] + - Name: group + Type: SHT_PROGBITS + Flags: [ SHF_GROUP ] + - Name: tls + Type: SHT_PROGBITS + Flags: [ SHF_TLS ] + - Name: compressed + Type: SHT_PROGBITS + Flags: [ SHF_COMPRESSED ] + - Name: exclude + Type: SHT_PROGBITS + Flags: [ SHF_EXCLUDE ] diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -1434,18 +1434,18 @@ static const EnumEntry ElfSectionFlags[] = { ENUM_ENT(SHF_WRITE, "W"), ENUM_ENT(SHF_ALLOC, "A"), - ENUM_ENT(SHF_EXCLUDE, "E"), ENUM_ENT(SHF_EXECINSTR, "X"), ENUM_ENT(SHF_MERGE, "M"), ENUM_ENT(SHF_STRINGS, "S"), ENUM_ENT(SHF_INFO_LINK, "I"), ENUM_ENT(SHF_LINK_ORDER, "L"), - ENUM_ENT(SHF_OS_NONCONFORMING, "o"), + ENUM_ENT(SHF_OS_NONCONFORMING, "O"), ENUM_ENT(SHF_GROUP, "G"), ENUM_ENT(SHF_TLS, "T"), + ENUM_ENT(SHF_COMPRESSED, "C"), + ENUM_ENT(SHF_EXCLUDE, "E"), ENUM_ENT(SHF_MASKOS, "o"), ENUM_ENT(SHF_MASKPROC, "p"), - ENUM_ENT_1(SHF_COMPRESSED), }; static const EnumEntry ElfXCoreSectionFlags[] = { @@ -1492,6 +1492,7 @@ case ELF::SHF_OS_NONCONFORMING: case ELF::SHF_GROUP: case ELF::SHF_TLS: + case ELF::SHF_COMPRESSED: case ELF::SHF_EXCLUDE: Str += Entry.AltName; break;