Index: llvm/test/tools/llvm-readobj/ELF/addrsig.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/addrsig.test +++ llvm/test/tools/llvm-readobj/ELF/addrsig.test @@ -58,13 +58,12 @@ # RUN: yaml2obj --docnum=3 %s -o %t3.o # RUN: llvm-readobj --addrsig %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=INVALID-INDEX -# INVALID-INDEX: Addrsig [ -# INVALID-INDEX-NEXT: Sym: foo (1) -# INVALID-INDEX-EMPTY: -# INVALID-INDEX-NEXT: warning: '[[FILE]]': unable to get symbol from section [index 2]: invalid symbol index (255) -# INVALID-INDEX-NEXT: Sym: (255) -# INVALID-INDEX-NEXT: Sym: bar (2) -# INVALID-INDEX-NEXT: ] +# INVALID-INDEX: Addrsig [ +# INVALID-INDEX-NEXT: Sym: foo (1) +# INVALID-INDEX-NEXT: warning: '[[FILE]]': unable to get symbol from section [index 2]: invalid symbol index (255) +# INVALID-INDEX-NEXT: Sym: (255) +# INVALID-INDEX-NEXT: Sym: bar (2) +# INVALID-INDEX-NEXT: ] --- !ELF FileHeader: Index: llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc-name.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc-name.test +++ llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc-name.test @@ -6,14 +6,12 @@ # RUN: llvm-readelf --dyn-relocations %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=GNU # LLVM: Dynamic Relocations { -# LLVM-EMPTY: # LLVM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: st_name (0x1234) is past the end of the string table of size 0x1 # LLVM-NEXT: 0x0 R_X86_64_NONE 0x0 # LLVM-NEXT: } # GNU: 'RELA' relocation section at offset {{.+}} contains 24 bytes: # GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend -# GNU-EMPTY: # GNU-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: st_name (0x1234) is past the end of the string table of size 0x1 # GNU-NEXT: 0000000000000000 0000000100000000 R_X86_64_NONE 0000000000000000 + 0 Index: llvm/test/tools/llvm-readobj/ELF/dependent-libraries.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/dependent-libraries.test +++ llvm/test/tools/llvm-readobj/ELF/dependent-libraries.test @@ -29,15 +29,13 @@ # RUN: yaml2obj --docnum=2 %s -o %t2 # RUN: llvm-readobj --dependent-libraries %t2 2>&1 | FileCheck %s --check-prefix=MIX -DFILE=%t2 -# MIX: DependentLibs [ -# MIX-EMPTY: -# MIX-NEXT: warning: '[[FILE]]': SHT_LLVM_DEPENDENT_LIBRARIES section at index 1 is broken: the content is not null-terminated -# MIX-NEXT: abc -# MIX-EMPTY: -# MIX-NEXT: warning: '[[FILE]]': SHT_LLVM_DEPENDENT_LIBRARIES section at index 4 is broken: section [index 4] has a sh_offset (0xffff0000) + sh_size (0x4) that is greater than the file size (0x2c0) -# MIX-NEXT: bar -# MIX-NEXT: xxx -# MIX-NEXT: ] +# MIX: DependentLibs [ +# MIX-NEXT: warning: '[[FILE]]': SHT_LLVM_DEPENDENT_LIBRARIES section at index 1 is broken: the content is not null-terminated +# MIX-NEXT: abc +# MIX-NEXT: warning: '[[FILE]]': SHT_LLVM_DEPENDENT_LIBRARIES section at index 4 is broken: section [index 4] has a sh_offset (0xffff0000) + sh_size (0x4) that is greater than the file size (0x2c0) +# MIX-NEXT: bar +# MIX-NEXT: xxx +# MIX-NEXT: ] --- !ELF FileHeader: Index: llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test +++ llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test @@ -7,14 +7,12 @@ # GNU-NEXT: There are 3 section headers, starting at offset 0x58: # GNU: Section Headers: # GNU-NEXT: [Nr] Name -# GNU-EMPTY: # GNU-NEXT: error: '[[FILE]]': section header string table index 255 does not exist # LLVM: ElfHeader { # LLVM: StringTableSectionIndex: 255 # LLVM-NEXT: } # LLVM-NEXT: Sections [ -# LLVM-EMPTY: # LLVM-NEXT: error: '[[FILE]]': section header string table index 255 does not exist --- !ELF Index: llvm/test/tools/llvm-readobj/ELF/linker-options.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/linker-options.test +++ llvm/test/tools/llvm-readobj/ELF/linker-options.test @@ -4,15 +4,13 @@ # RUN: yaml2obj --docnum=1 %s -o %t1 # RUN: llvm-readobj --elf-linker-options %t1 2>&1 | FileCheck %s --check-prefix=CHECK -DFILE=%t1 -# CHECK: LinkerOptions [ -# CHECK: option 0: value 0 -# CHECK: option 1: value 1 -# CHECK-EMPTY: -# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 2 is broken: an incomplete key-value pair was found. The last possible key was: "c" -# CHECK-EMPTY: -# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 4 is broken: the content is not null-terminated -# CHECK-NEXT: option 3: value 3 -# CHECK-NEXT: ] +# CHECK: LinkerOptions [ +# CHECK: option 0: value 0 +# CHECK: option 1: value 1 +# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 2 is broken: an incomplete key-value pair was found. The last possible key was: "c" +# CHECK-NEXT: warning: '[[FILE]]': SHT_LLVM_LINKER_OPTIONS section at index 4 is broken: the content is not null-terminated +# CHECK-NEXT: option 3: value 3 +# CHECK-NEXT: ] --- !ELF FileHeader: Index: llvm/test/tools/llvm-readobj/ELF/verdef-invalid.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/verdef-invalid.test +++ llvm/test/tools/llvm-readobj/ELF/verdef-invalid.test @@ -277,13 +277,11 @@ # INVALID-VERDEF-LLVM-NEXT: } # INVALID-VERDEF-LLVM-NEXT: Symbol { # INVALID-VERDEF-LLVM-NEXT: Version: 2 -# INVALID-VERDEF-LLVM-EMPTY: # INVALID-VERDEF-LLVM-NEXT: warning: '[[FILE]]': invalid SHT_GNU_verdef section with index 2: version definition 1 goes past the end of the section # INVALID-VERDEF-LLVM-NEXT: Name: foo@ # INVALID-VERDEF-GNU: Version symbols section '.gnu.version' contains 2 entries: # INVALID-VERDEF-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) -# INVALID-VERDEF-GNU-EMPTY: # INVALID-VERDEF-GNU-NEXT: warning: '[[FILE]]': unable to get a version for entry 1 of SHT_GNU_versym section with index 1: invalid SHT_GNU_verdef section with index 2: version definition 1 goes past the end of the section # INVALID-VERDEF-GNU-NEXT: 000: 0 (*local*) 2 () Index: llvm/test/tools/llvm-readobj/ELF/verneed-invalid.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/verneed-invalid.test +++ llvm/test/tools/llvm-readobj/ELF/verneed-invalid.test @@ -86,10 +86,8 @@ # GNU-NOLINK: Version symbols section '.gnu.version' contains 2 entries: # GNU-NOLINK-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) -# GNU-NOLINK-EMPTY: # GNU-NOLINK-NEXT: warning: '[[FILE]]': invalid string table linked to SHT_GNU_verneed section with index 2: invalid sh_type for string table section [index 0]: expected SHT_STRTAB, but got SHT_NULL # GNU-NOLINK-NEXT: 000: 0 (*local*) 2 () -# GNU-NOLINK-EMPTY: # GNU-NOLINK: Version needs section '.gnu.version_r' contains 1 entries: # GNU-NOLINK-NEXT: Addr: 0000000000000000 Offset: 0x000044 Link: 0 () # GNU-NOLINK-NEXT: 0x0000: Version: 1 File: Cnt: 1 @@ -102,7 +100,6 @@ # LLVM-NOLINK-NEXT: } # LLVM-NOLINK-NEXT: Symbol { # LLVM-NOLINK-NEXT: Version: 2 -# LLVM-NOLINK-EMPTY: # LLVM-NOLINK-NEXT: warning: '[[FILE]]': invalid string table linked to SHT_GNU_verneed section with index 2: invalid sh_type for string table section [index 0]: expected SHT_STRTAB, but got SHT_NULL # LLVM-NOLINK-NEXT: Name: foo@ # LLVM-NOLINK-NEXT: } @@ -161,20 +158,18 @@ # RUN: llvm-readelf -V %t3 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=BROKEN-AUX-GNU # RUN: llvm-readobj -V %t3 2>&1 | FileCheck %s -DFILE=%t3 --check-prefix=BROKEN-AUX-LLVM -# BROKEN-AUX-GNU: Version symbols section '.gnu.version' contains 1 entries: -# BROKEN-AUX-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) -# BROKEN-AUX-GNU-EMPTY: -# BROKEN-AUX-GNU-NEXT: warning: '[[FILE]]': unable to get a version for entry 0 of SHT_GNU_versym section with index 1: invalid SHT_GNU_verneed section with index 2: found a misaligned auxiliary entry at offset 0x11 -# BROKEN-AUX-GNU-NEXT: 000: 2 () - -# BROKEN-AUX-LLVM: VersionSymbols [ -# BROKEN-AUX-LLVM-NEXT: Symbol { -# BROKEN-AUX-LLVM-NEXT: Version: 2 -# BROKEN-AUX-LLVM-EMPTY: -# BROKEN-AUX-LLVM-NEXT: warning: '[[FILE]]': invalid SHT_GNU_verneed section with index 2: found a misaligned auxiliary entry at offset 0x11 -# BROKEN-AUX-LLVM-NEXT: Name: @ -# BROKEN-AUX-LLVM-NEXT: } -# BROKEN-AUX-LLVM-NEXT: ] +# BROKEN-AUX-GNU: Version symbols section '.gnu.version' contains 1 entries: +# BROKEN-AUX-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) +# BROKEN-AUX-GNU-NEXT: warning: '[[FILE]]': unable to get a version for entry 0 of SHT_GNU_versym section with index 1: invalid SHT_GNU_verneed section with index 2: found a misaligned auxiliary entry at offset 0x11 +# BROKEN-AUX-GNU-NEXT: 000: 2 () + +# BROKEN-AUX-LLVM: VersionSymbols [ +# BROKEN-AUX-LLVM-NEXT: Symbol { +# BROKEN-AUX-LLVM-NEXT: Version: 2 +# BROKEN-AUX-LLVM-NEXT: warning: '[[FILE]]': invalid SHT_GNU_verneed section with index 2: found a misaligned auxiliary entry at offset 0x11 +# BROKEN-AUX-LLVM-NEXT: Name: @ +# BROKEN-AUX-LLVM-NEXT: } +# BROKEN-AUX-LLVM-NEXT: ] --- !ELF FileHeader: @@ -329,8 +324,7 @@ # RUN: llvm-readobj --sections -V %t6 2>&1 | FileCheck %s -DFILE=%t6 --implicit-check-not="warning:" --check-prefix=INVALID-LINK-LLVM # RUN: llvm-readelf --sections -V %t6 2>&1 | FileCheck %s -DFILE=%t6 --implicit-check-not="warning:" --check-prefix=INVALID-LINK-GNU -# INVALID-LINK-LLVM: VersionRequirements [ -# INVALID-LINK-LLVM-EMPTY: +# INVALID-LINK-LLVM: VersionRequirements [ # INVALID-LINK-LLVM-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_verneed section with index 1: invalid section index: 255 # INVALID-LINK-LLVM-NEXT: Dependency { # INVALID-LINK-LLVM-NEXT: Version: 1 @@ -348,12 +342,11 @@ # INVALID-LINK-LLVM-NEXT: } # INVALID-LINK-LLVM-NEXT: ] -# INVALID-LINK-GNU: Version needs section '.gnu.version_r' contains 1 entries: -# INVALID-LINK-GNU-EMPTY: -# INVALID-LINK-GNU-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_verneed section with index 1: invalid section index: 255 -# INVALID-LINK-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 255 () -# INVALID-LINK-GNU-NEXT: 0x0000: Version: 1 File: Cnt: 1 -# INVALID-LINK-GNU-NEXT: 0x0010: Name: Flags: none Version: 0 +# INVALID-LINK-GNU: Version needs section '.gnu.version_r' contains 1 entries: +# INVALID-LINK-GNU-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_verneed section with index 1: invalid section index: 255 +# INVALID-LINK-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 255 () +# INVALID-LINK-GNU-NEXT: 0x0000: Version: 1 File: Cnt: 1 +# INVALID-LINK-GNU-NEXT: 0x0010: Name: Flags: none Version: 0 --- !ELF FileHeader: Index: llvm/test/tools/llvm-readobj/ELF/versym-invalid.test =================================================================== --- llvm/test/tools/llvm-readobj/ELF/versym-invalid.test +++ llvm/test/tools/llvm-readobj/ELF/versym-invalid.test @@ -6,15 +6,13 @@ # RUN: llvm-readelf -V %t1 2>&1 | FileCheck -DFILE=%t1 %s --check-prefix=GNU-INVALID-LINK # RUN: llvm-readobj -V %t1 2>&1 | FileCheck -DFILE=%t1 %s --check-prefix=LLVM-INVALID-LINK -# GNU-INVALID-LINK: Version symbols section '.gnu.version' contains 0 entries: -# GNU-INVALID-LINK-EMPTY: -# GNU-INVALID-LINK-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: invalid section index: 255 -# GNU-INVALID-LINK-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 255 () +# GNU-INVALID-LINK: Version symbols section '.gnu.version' contains 0 entries: +# GNU-INVALID-LINK-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: invalid section index: 255 +# GNU-INVALID-LINK-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 255 () -# LLVM-INVALID-LINK: VersionSymbols [ -# LLVM-INVALID-LINK-EMPTY: -# LLVM-INVALID-LINK-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: invalid section index: 255 -# LLVM-INVALID-LINK-NEXT: ] +# LLVM-INVALID-LINK: VersionSymbols [ +# LLVM-INVALID-LINK-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: invalid section index: 255 +# LLVM-INVALID-LINK-NEXT: ] --- !ELF FileHeader: @@ -35,16 +33,14 @@ # RUN: llvm-readelf -V %t2 2>&1 | FileCheck -DFILE=%t2 %s --check-prefix=INVALID-SYMBOL-TABLE-GNU # RUN: llvm-readobj -V %t2 2>&1 | FileCheck -DFILE=%t2 %s --check-prefix=INVALID-SYMBOL-TABLE-LLVM -# INVALID-SYMBOL-TABLE-GNU: Version symbols section '.gnu.version' contains 1 entries: -# INVALID-SYMBOL-TABLE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 0 () -# INVALID-SYMBOL-TABLE-GNU-EMPTY: -# INVALID-SYMBOL-TABLE-GNU-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: expected SHT_DYNSYM, but got SHT_NULL -# INVALID-SYMBOL-TABLE-GNU-NEXT: 000: 0 (*local*) +# INVALID-SYMBOL-TABLE-GNU: Version symbols section '.gnu.version' contains 1 entries: +# INVALID-SYMBOL-TABLE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 0 () +# INVALID-SYMBOL-TABLE-GNU-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: expected SHT_DYNSYM, but got SHT_NULL +# INVALID-SYMBOL-TABLE-GNU-NEXT: 000: 0 (*local*) -# INVALID-SYMBOL-TABLE-LLVM: VersionSymbols [ -# INVALID-SYMBOL-TABLE-LLVM-EMPTY: -# INVALID-SYMBOL-TABLE-LLVM-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: expected SHT_DYNSYM, but got SHT_NULL -# INVALID-SYMBOL-TABLE-LLVM-NEXT: ] +# INVALID-SYMBOL-TABLE-LLVM: VersionSymbols [ +# INVALID-SYMBOL-TABLE-LLVM-NEXT: warning: '[[FILE]]': invalid section linked to SHT_GNU_versym section with index 1: expected SHT_DYNSYM, but got SHT_NULL +# INVALID-SYMBOL-TABLE-LLVM-NEXT: ] --- !ELF FileHeader: @@ -66,16 +62,14 @@ # RUN: llvm-readelf -V %t3 2>&1 | FileCheck -DFILE=%t3 %s --check-prefix=INVALID-STRING-TABLE-GNU # RUN: llvm-readobj -V %t3 2>&1 | FileCheck -DFILE=%t3 %s --check-prefix=INVALID-STRING-TABLE-LLVM -# INVALID-STRING-TABLE-GNU: Version symbols section '.gnu.version' contains 1 entries: -# INVALID-STRING-TABLE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) -# INVALID-STRING-TABLE-GNU-EMPTY: -# INVALID-STRING-TABLE-GNU-NEXT: warning: '[[FILE]]': can't get a string table for the symbol table linked to SHT_GNU_versym section with index 1: invalid string table linked to SHT_DYNSYM section with index 5: invalid sh_type for string table section [index 2]: expected SHT_STRTAB, but got SHT_NULL -# INVALID-STRING-TABLE-GNU-NEXT: 000: 0 (*local*) +# INVALID-STRING-TABLE-GNU: Version symbols section '.gnu.version' contains 1 entries: +# INVALID-STRING-TABLE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 5 (.dynsym) +# INVALID-STRING-TABLE-GNU-NEXT: warning: '[[FILE]]': can't get a string table for the symbol table linked to SHT_GNU_versym section with index 1: invalid string table linked to SHT_DYNSYM section with index 5: invalid sh_type for string table section [index 2]: expected SHT_STRTAB, but got SHT_NULL +# INVALID-STRING-TABLE-GNU-NEXT: 000: 0 (*local*) -# INVALID-STRING-TABLE-LLVM: VersionSymbols [ -# INVALID-STRING-TABLE-LLVM-EMPTY: -# INVALID-STRING-TABLE-LLVM-NEXT: warning: '[[FILE]]': can't get a string table for the symbol table linked to SHT_GNU_versym section with index 1: invalid string table linked to SHT_DYNSYM section with index 5: invalid sh_type for string table section [index 2]: expected SHT_STRTAB, but got SHT_NULL -# INVALID-STRING-TABLE-LLVM-NEXT: ] +# INVALID-STRING-TABLE-LLVM: VersionSymbols [ +# INVALID-STRING-TABLE-LLVM-NEXT: warning: '[[FILE]]': can't get a string table for the symbol table linked to SHT_GNU_versym section with index 1: invalid string table linked to SHT_DYNSYM section with index 5: invalid sh_type for string table section [index 2]: expected SHT_STRTAB, but got SHT_NULL +# INVALID-STRING-TABLE-LLVM-NEXT: ] --- !ELF FileHeader: @@ -98,15 +92,13 @@ # RUN: llvm-readelf -V %t4 2>&1 | FileCheck -DFILE=%t4 %s --check-prefix=MISALIGNED-GNU # RUN: llvm-readobj -V %t4 2>&1 | FileCheck -DFILE=%t4 %s --check-prefix=MISALIGNED-LLVM -# MISALIGNED-GNU: Version symbols section '.gnu.version' contains 0 entries: -# MISALIGNED-GNU-NEXT: Addr: 0000000000000000 Offset: 0x00ffff Link: 0 () -# MISALIGNED-GNU-EMPTY: -# MISALIGNED-GNU-NEXT: warning: '[[FILE]]': the SHT_GNU_versym section with index 1 is misaligned +# MISALIGNED-GNU: Version symbols section '.gnu.version' contains 0 entries: +# MISALIGNED-GNU-NEXT: Addr: 0000000000000000 Offset: 0x00ffff Link: 0 () +# MISALIGNED-GNU-NEXT: warning: '[[FILE]]': the SHT_GNU_versym section with index 1 is misaligned -# MISALIGNED-LLVM: VersionSymbols [ -# MISALIGNED-LLVM-EMPTY: -# MISALIGNED-LLVM-NEXT: warning: '[[FILE]]': the SHT_GNU_versym section with index 1 is misaligned -# MISALIGNED-LLVM-NEXT: ] +# MISALIGNED-LLVM: VersionSymbols [ +# MISALIGNED-LLVM-NEXT: warning: '[[FILE]]': the SHT_GNU_versym section with index 1 is misaligned +# MISALIGNED-LLVM-NEXT: ] --- !ELF FileHeader: @@ -126,15 +118,13 @@ # RUN: llvm-readelf -V %t5 2>&1 | FileCheck -DFILE=%t5 %s --check-prefix=INVALID-ENT-SIZE-GNU # RUN: llvm-readobj -V %t5 2>&1 | FileCheck -DFILE=%t5 %s --check-prefix=INVALID-ENT-SIZE-LLVM -# INVALID-ENT-SIZE-GNU: Version symbols section '.gnu.version' contains 1 entries: -# INVALID-ENT-SIZE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 0 () -# INVALID-ENT-SIZE-GNU-EMPTY: -# INVALID-ENT-SIZE-GNU-NEXT: warning: '[[FILE]]': cannot read content of SHT_GNU_versym section with index 1: section [index 1] has an invalid sh_entsize: 3 +# INVALID-ENT-SIZE-GNU: Version symbols section '.gnu.version' contains 1 entries: +# INVALID-ENT-SIZE-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 0 () +# INVALID-ENT-SIZE-GNU-NEXT: warning: '[[FILE]]': cannot read content of SHT_GNU_versym section with index 1: section [index 1] has an invalid sh_entsize: 3 -# INVALID-ENT-SIZE-LLVM: VersionSymbols [ -# INVALID-ENT-SIZE-LLVM-EMPTY: -# INVALID-ENT-SIZE-LLVM-NEXT: warning: '[[FILE]]': cannot read content of SHT_GNU_versym section with index 1: section [index 1] has an invalid sh_entsize: 3 -# INVALID-ENT-SIZE-LLVM-NEXT: ] +# INVALID-ENT-SIZE-LLVM: VersionSymbols [ +# INVALID-ENT-SIZE-LLVM-NEXT: warning: '[[FILE]]': cannot read content of SHT_GNU_versym section with index 1: section [index 1] has an invalid sh_entsize: 3 +# INVALID-ENT-SIZE-LLVM-NEXT: ] --- !ELF FileHeader: @@ -154,16 +144,14 @@ # RUN: llvm-readelf -V %t6 2>&1 | FileCheck -DFILE=%t6 %s --check-prefix=SYMBOLS-NUM-MISMATCH-GNU # RUN: llvm-readobj -V %t6 2>&1 | FileCheck -DFILE=%t6 %s --check-prefix=SYMBOLS-NUM-MISMATCH-LLVM -# SYMBOLS-NUM-MISMATCH-GNU: Version symbols section '.gnu.version' contains 2 entries: -# SYMBOLS-NUM-MISMATCH-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 4 (.dynsym) -# SYMBOLS-NUM-MISMATCH-GNU-EMPTY: -# SYMBOLS-NUM-MISMATCH-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section with index 1: the number of entries (2) does not match the number of symbols (3) in the symbol table with index 4 -# SYMBOLS-NUM-MISMATCH-GNU-NEXT: 000: 0 (*local*) 1 (*global*) +# SYMBOLS-NUM-MISMATCH-GNU: Version symbols section '.gnu.version' contains 2 entries: +# SYMBOLS-NUM-MISMATCH-GNU-NEXT: Addr: 0000000000000000 Offset: 0x000040 Link: 4 (.dynsym) +# SYMBOLS-NUM-MISMATCH-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section with index 1: the number of entries (2) does not match the number of symbols (3) in the symbol table with index 4 +# SYMBOLS-NUM-MISMATCH-GNU-NEXT: 000: 0 (*local*) 1 (*global*) -# SYMBOLS-NUM-MISMATCH-LLVM: VersionSymbols [ -# SYMBOLS-NUM-MISMATCH-LLVM-EMPTY: -# SYMBOLS-NUM-MISMATCH-LLVM-NEXT: warning: '[[FILE]]': SHT_GNU_versym section with index 1: the number of entries (2) does not match the number of symbols (3) in the symbol table with index 4 -# SYMBOLS-NUM-MISMATCH-LLVM-NEXT: ] +# SYMBOLS-NUM-MISMATCH-LLVM: VersionSymbols [ +# SYMBOLS-NUM-MISMATCH-LLVM-NEXT: warning: '[[FILE]]': SHT_GNU_versym section with index 1: the number of entries (2) does not match the number of symbols (3) in the symbol table with index 4 +# SYMBOLS-NUM-MISMATCH-LLVM-NEXT: ] --- !ELF FileHeader: @@ -228,26 +216,23 @@ # RUN: llvm-readelf --dyn-syms %t8 2>&1 \ # RUN: | FileCheck -DFILE=%t8 --implicit-check-not=warning --check-prefix=VERSION-OVERFLOW-GNU %s -# VERSION-OVERFLOW-LLVM: DynamicSymbols [ -# VERSION-OVERFLOW-LLVM-EMPTY: -# VERSION-OVERFLOW-LLVM-NEXT: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 255 which is missing -# VERSION-OVERFLOW-LLVM-NEXT: Symbol { -# VERSION-OVERFLOW-LLVM-NEXT: Name: @ (0) -# VERSION-OVERFLOW-LLVM: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 254 which is missing -# VERSION-OVERFLOW-LLVM-NEXT: Symbol { -# VERSION-OVERFLOW-LLVM-NEXT: Name: foo@ (5) -# VERSION-OVERFLOW-LLVM: Symbol { -# VERSION-OVERFLOW-LLVM-NEXT: Name: bar@ (1) - -# VERSION-OVERFLOW-GNU: Symbol table '.dynsym' contains 3 entries: -# VERSION-OVERFLOW-GNU-NEXT: Num: Value Size Type Bind Vis Ndx Name -# VERSION-OVERFLOW-GNU-EMPTY: -# VERSION-OVERFLOW-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 255 which is missing -# VERSION-OVERFLOW-GNU-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND @ -# VERSION-OVERFLOW-GNU-EMPTY: -# VERSION-OVERFLOW-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 254 which is missing -# VERSION-OVERFLOW-GNU-NEXT: 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND foo@ -# VERSION-OVERFLOW-GNU-NEXT: 2: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND bar@ (0) +# VERSION-OVERFLOW-LLVM: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 254 which is missing +# VERSION-OVERFLOW-LLVM-NEXT: Symbol { +# VERSION-OVERFLOW-LLVM-NEXT: Name: foo@ (5) +# VERSION-OVERFLOW-LLVM: Symbol { +# VERSION-OVERFLOW-LLVM-NEXT: Name: bar@ (1) + +# VERSION-OVERFLOW-GNU: Symbol table '.dynsym' contains 3 entries: +# VERSION-OVERFLOW-GNU-NEXT: Num: Value Size Type Bind Vis Ndx Name +# VERSION-OVERFLOW-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 255 which is missing +# VERSION-OVERFLOW-GNU-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND @ +# VERSION-OVERFLOW-GNU-NEXT: warning: '[[FILE]]': SHT_GNU_versym section refers to a version index 254 which is missing +# VERSION-OVERFLOW-GNU-NEXT: 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND foo@ +# VERSION-OVERFLOW-GNU-NEXT: 2: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND bar@