[llvm-branch-commits] [llvm] [llvm-readobj][ELF] Use WrappedError to filter duplicates (PR #191708)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Apr 12 06:06:37 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-binary-utilities
Author: aokblast
<details>
<summary>Changes</summary>
Switch from StringError to WrappedError. Errors of the form "Prefix: Error" can now be filtered out based on the underlying error while preserving distinct prefixes, resulting in clearer llvm-readobj output.
---
Patch is 74.22 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/191708.diff
17 Files Affected:
- (modified) llvm/test/Object/invalid.test (+1-1)
- (modified) llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test (-2)
- (modified) llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test (-11)
- (modified) llvm/test/tools/llvm-readobj/ELF/gnu-notes.test (+1-2)
- (modified) llvm/test/tools/llvm-readobj/ELF/gnu-section-mapping.test (+1-1)
- (modified) llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test (-2)
- (modified) llvm/test/tools/llvm-readobj/ELF/packed-relocs-errors.s (+16-13)
- (modified) llvm/test/tools/llvm-readobj/ELF/packed-relocs.test (-2)
- (modified) llvm/test/tools/llvm-readobj/ELF/program-headers.test (+4-7)
- (modified) llvm/test/tools/llvm-readobj/ELF/relocation-errors.test (-3)
- (modified) llvm/test/tools/llvm-readobj/ELF/relocations.test (-3)
- (modified) llvm/test/tools/llvm-readobj/ELF/relr-relocs.test (-1)
- (modified) llvm/test/tools/llvm-readobj/ELF/stack-sizes.test (-7)
- (modified) llvm/test/tools/llvm-readobj/ELF/versym-invalid.test (-2)
- (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+206-194)
- (modified) llvm/tools/llvm-readobj/ObjDumper.cpp (+20-8)
- (modified) llvm/tools/llvm-readobj/ObjDumper.h (+2-1)
``````````diff
diff --git a/llvm/test/Object/invalid.test b/llvm/test/Object/invalid.test
index 58ec3cbeadd19..43f3b8fc7473b 100644
--- a/llvm/test/Object/invalid.test
+++ b/llvm/test/Object/invalid.test
@@ -236,7 +236,7 @@ Symbols: []
# RUN: llvm-readobj --program-headers %p/Inputs/invalid-e_shnum.elf 2>&1 | \
# RUN: FileCheck -DFILE=%p/Inputs/invalid-e_shnum.elf --check-prefix=INVALID-PH-ENTSIZE %s
-# INVALID-PH-ENTSIZE: warning: '[[FILE]]': unable to dump program headers: invalid e_phentsize: 12336
+# INVALID-PH-ENTSIZE: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 12336
## Check that llvm-readobj reports a warning when we have no SHT_SYMTAB_SHNDX section,
## but have a symbol referencing it.
diff --git a/llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test b/llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test
index 9f18248e7921d..dfdb76a68b6dd 100644
--- a/llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test
+++ b/llvm/test/tools/llvm-readobj/ELF/broken-dynamic-reloc.test
@@ -217,7 +217,6 @@ ProgramHeaders:
# LLVM-NO-DYNSYM: Dynamic Relocations {
# LLVM-NO-DYNSYM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 0: no dynamic symbol table found
# LLVM-NO-DYNSYM-NEXT: 0x0 R_X86_64_NONE <corrupt> 0x0
-# LLVM-NO-DYNSYM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: no dynamic symbol table found
# LLVM-NO-DYNSYM-NEXT: 0x0 R_X86_64_NONE <corrupt> 0x0
# LLVM-NO-DYNSYM-NEXT: }
@@ -225,7 +224,6 @@ ProgramHeaders:
# GNU-NO-DYNSYM-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
# GNU-NO-DYNSYM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 0: no dynamic symbol table found
# GNU-NO-DYNSYM-NEXT: 0000000000000000 0000000000000000 R_X86_64_NONE <corrupt> + 0
-# GNU-NO-DYNSYM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: no dynamic symbol table found
# GNU-NO-DYNSYM-NEXT: 0000000000000000 0000000100000000 R_X86_64_NONE <corrupt> + 0
--- !ELF
diff --git a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
index dec2353fa74dd..e63719c014c02 100644
--- a/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
+++ b/llvm/test/tools/llvm-readobj/ELF/dynamic-tags.test
@@ -848,18 +848,7 @@ Sections:
# RUN: --check-prefixes=PHENTSIZE-WARN,PHENTSIZE-GNU
# PHENTSIZE-WARN: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_HASH: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_STRTAB: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_SYMTAB: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_RELA: invalid e_phentsize: 1
# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': DT_SYMENT value of 0x987 is not the size of a symbol (0x18)
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_REL: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_JMPREL: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_SYMTAB_SHNDX: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_RELR: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_CREL: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_ANDROID_RELR: invalid e_phentsize: 1
-# PHENTSIZE-WARN-NEXT: warning: '[[FILE]]': unable to parse DT_GNU_HASH: invalid e_phentsize: 1
# PHENTSIZE-LLVM: warning: '[[FILE]]': string table was not found
# PHENTSIZE-LLVM-NEXT: LoadName: <?>
diff --git a/llvm/test/tools/llvm-readobj/ELF/gnu-notes.test b/llvm/test/tools/llvm-readobj/ELF/gnu-notes.test
index 49b8f0dd2c5d8..5e4b4b0852202 100644
--- a/llvm/test/tools/llvm-readobj/ELF/gnu-notes.test
+++ b/llvm/test/tools/llvm-readobj/ELF/gnu-notes.test
@@ -263,8 +263,7 @@ ProgramHeaders:
# RUN: llvm-readobj --notes %t6.so 2>&1 | FileCheck %s -DFILE=%t6.so --check-prefix=PHENTSIZE-WARN-LLVM
# PHENTSIZE-WARN-GNU: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
-# PHENTSIZE-WARN-GNU: warning: '[[FILE]]': unable to read program headers to locate the PT_NOTE segment: invalid e_phentsize: 1
+# PHENTSIZE-WARN-LLVM: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
# PHENTSIZE-WARN-LLVM: NoteSections [
-# PHENTSIZE-WARN-LLVM-NEXT: warning: '[[FILE]]': unable to read program headers to locate the PT_NOTE segment: invalid e_phentsize: 1
# PHENTSIZE-WARN-LLVM-NEXT: ]
diff --git a/llvm/test/tools/llvm-readobj/ELF/gnu-section-mapping.test b/llvm/test/tools/llvm-readobj/ELF/gnu-section-mapping.test
index 24eb004a8a476..a83469e49042e 100644
--- a/llvm/test/tools/llvm-readobj/ELF/gnu-section-mapping.test
+++ b/llvm/test/tools/llvm-readobj/ELF/gnu-section-mapping.test
@@ -77,6 +77,6 @@ ProgramHeaders:
# RUN: llvm-readelf --section-mapping %t64-err1.elf 2>&1 | \
# RUN: FileCheck %s -DFILE=%t64-err1.elf --check-prefix=PHENTSIZE
+# PHENTSIZE: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
# PHENTSIZE: Section to Segment mapping:
# PHENTSIZE-NEXT: Segment Sections...
-# PHENTSIZE-NEXT: warning: '[[FILE]]': can't read program headers to build section to segment mapping: invalid e_phentsize: 1
diff --git a/llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test b/llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test
index 7d424ec6db0ff..9a8ae131504d0 100644
--- a/llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test
+++ b/llvm/test/tools/llvm-readobj/ELF/invalid-shstrndx.test
@@ -36,10 +36,8 @@
# LLVM-NEXT: EntrySize: 0
# LLVM-NEXT: }
# LLVM: Index: 1
-# LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_STRTAB section with index 1: section header string table index 255 does not exist
# LLVM-NEXT: Name: <?> (11)
# LLVM: Index: 2
-# LLVM-NEXT: warning: '[[FILE]]': unable to get the name of SHT_STRTAB section with index 2: section header string table index 255 does not exist
# LLVM-NEXT: Name: <?> (1)
--- !ELF
diff --git a/llvm/test/tools/llvm-readobj/ELF/packed-relocs-errors.s b/llvm/test/tools/llvm-readobj/ELF/packed-relocs-errors.s
index 32e96d716ca44..51b6a2ef25799 100644
--- a/llvm/test/tools/llvm-readobj/ELF/packed-relocs-errors.s
+++ b/llvm/test/tools/llvm-readobj/ELF/packed-relocs-errors.s
@@ -6,28 +6,30 @@
# RUN: split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm1.s -o %t1.o
-# RUN: llvm-readobj --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER
-# RUN: llvm-readelf --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER
+# RUN: llvm-readobj --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER-LLVM
+# RUN: llvm-readelf --relocations %t1.o 2>&1 | FileCheck %s -DFILE=%t1.o --check-prefix=ERR-HEADER-GNU
#--- asm1.s
.section .rela.dyn, "a", @0x60000001
.ascii "APS9"
-# ERR-HEADER: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: invalid packed relocation header
+# ERR-HEADER-LLVM: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: invalid packed relocation header
+# ERR-HEADER-GNU: warning: '[[FILE]]': unable to get the number of relocations in SHT_ANDROID_REL section with index 3: invalid packed relocation header
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm2.s -o %t2.o
-# RUN: llvm-readobj --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END
-# RUN: llvm-readelf --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END
+# RUN: llvm-readobj --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END-LLVM
+# RUN: llvm-readelf --relocations %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=ERR-PAST-END-GNU
#--- asm2.s
.section .rela.dyn, "a", @0x60000001
.ascii "APS2"
-# ERR-PAST-END: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: unable to decode LEB128 at offset 0x{{([[:xdigit:]]{8})}}: malformed sleb128, extends past end
+# ERR-PAST-END-LLVM: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: unable to decode LEB128 at offset 0x{{([[:xdigit:]]{8})}}: malformed sleb128, extends past end
+# ERR-PAST-END-GNU: warning: '[[FILE]]': unable to get the number of relocations in SHT_ANDROID_REL section with index 3: unable to decode LEB128 at offset 0x{{([[:xdigit:]]{8})}}: malformed sleb128, extends past end
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm3.s -o %t3.o
-# RUN: llvm-readobj --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END
-# RUN: llvm-readelf --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END
+# RUN: llvm-readobj --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END-LLVM
+# RUN: llvm-readelf --relocations %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=ERR-PAST-END-GNU
#--- asm3.s
.section .rela.dyn, "a", @0x60000001
@@ -36,8 +38,8 @@
.sleb128 0 ## Initial offset
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm4.s -o %t4.o
-# RUN: llvm-readobj --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END
-# RUN: llvm-readelf --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END
+# RUN: llvm-readobj --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END-LLVM
+# RUN: llvm-readelf --relocations %t4.o 2>&1 | FileCheck %s -DFILE=%t4.o --check-prefix=ERR-PAST-END-GNU
#--- asm4.s
.section .rela.dyn, "a", @0x60000001
@@ -50,10 +52,11 @@
.sleb128 8 ## offset delta
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %t/asm5.s -o %t5.o
-# RUN: llvm-readobj --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE
-# RUN: llvm-readelf --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE
+# RUN: llvm-readobj --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE-LLVM
+# RUN: llvm-readelf --relocations %t5.o 2>&1 | FileCheck %s -DFILE=%t5.o --check-prefix=ERR-LARGE-GNU
-# ERR-LARGE: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: relocation group unexpectedly large
+# ERR-LARGE-LLVM: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 3: relocation group unexpectedly large
+# ERR-LARGE-GNU: warning: '[[FILE]]': unable to get the number of relocations in SHT_ANDROID_REL section with index 3: relocation group unexpectedly large
#--- asm5.s
.section .rela.dyn, "a", @0x60000001
diff --git a/llvm/test/tools/llvm-readobj/ELF/packed-relocs.test b/llvm/test/tools/llvm-readobj/ELF/packed-relocs.test
index d209a00fdd560..1bc2110b3e285 100644
--- a/llvm/test/tools/llvm-readobj/ELF/packed-relocs.test
+++ b/llvm/test/tools/llvm-readobj/ELF/packed-relocs.test
@@ -60,7 +60,6 @@ Symbols:
# BROKEN-RELA-GNU: warning: '[[FILE]]': unable to get the number of relocations in SHT_ANDROID_RELA section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x3a) that is greater than the file size (0x238)
# BROKEN-RELA-GNU: Relocation section '.rela.dyn' at offset 0xffffffff contains <?> entries:
# BROKEN-RELA-GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
-# BROKEN-RELA-GNU-NEXT: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_RELA section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x3a) that is greater than the file size (0x238)
## Check we report a warning when the sh_link field of the SHT_ANDROID_RELA section is broken.
@@ -143,7 +142,6 @@ Symbols:
# BROKEN-REL-GNU: warning: '[[FILE]]': unable to get the number of relocations in SHT_ANDROID_REL section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x12) that cannot be represented
# BROKEN-REL-GNU: Relocation section '.rel.dyn' at offset 0xffffffff contains <?> entries:
# BROKEN-REL-GNU-NEXT: Offset Info Type Sym. Value Symbol's Name
-# BROKEN-REL-GNU-NEXT: warning: '[[FILE]]': unable to read relocations from SHT_ANDROID_REL section with index 1: section [index 1] has a sh_offset (0xffffffff) + sh_size (0x12) that cannot be represented
## Check we report a warning when the sh_link field of the SHT_ANDROID_REL section is broken.
diff --git a/llvm/test/tools/llvm-readobj/ELF/program-headers.test b/llvm/test/tools/llvm-readobj/ELF/program-headers.test
index 856cf378ddad9..88c615b455489 100644
--- a/llvm/test/tools/llvm-readobj/ELF/program-headers.test
+++ b/llvm/test/tools/llvm-readobj/ELF/program-headers.test
@@ -694,7 +694,6 @@ ProgramHeaders:
# ERROR-INTERP-NEXT: INTERP 0x000[[#OFFSET + 3]]
# ERROR-INTERP-NEXT: warning: '[[FILE]]': unable to read program interpreter name at offset 0x[[#OFFSET+3]]: it goes past the end of the file (0x[[#OFFSET + 3]])
# ERROR-INTERP-NEXT: INTERP 0xaabbccddeeff1122
-# ERROR-INTERP-NEXT: warning: '[[FILE]]': unable to read program interpreter name at offset 0xaabbccddeeff1122: it goes past the end of the file (0x[[#OFFSET + 3]])
# ERROR-INTERP-NEXT: INTERP 0xaabbccddeeff1122
--- !ELF
@@ -733,15 +732,14 @@ ProgramHeaders:
# RUN: llvm-readobj --program-headers %t.phdr.err 2>&1 | \
# RUN: FileCheck %s -DFILE=%t.phdr.err --check-prefix=WARN-PHENTSIZE-LLVM
+# WARN-PHENTSIZE-GNU: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
# WARN-PHENTSIZE-GNU: Program Headers:
# WARN-PHENTSIZE-GNU-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# WARN-PHENTSIZE-GNU-NEXT: warning: '[[FILE]]': unable to dump program headers: invalid e_phentsize: 1
# WARN-PHENTSIZE-GNU: Section to Segment mapping:
# WARN-PHENTSIZE-GNU-NEXT: Segment Sections...
-# WARN-PHENTSIZE-GNU-NEXT: warning: '[[FILE]]': can't read program headers to build section to segment mapping: invalid e_phentsize: 1
+# WARN-PHENTSIZE-LLVM: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: invalid e_phentsize: 1
# WARN-PHENTSIZE-LLVM: ProgramHeaders [
-# WARN-PHENTSIZE-LLVM-NEXT: warning: '[[FILE]]': unable to dump program headers: invalid e_phentsize: 1
# WARN-PHENTSIZE-LLVM-NEXT: ]
--- !ELF
@@ -774,15 +772,14 @@ ProgramHeaders:
# RUN: llvm-readobj --program-headers %t.phdr.err2 2>&1 | \
# RUN: FileCheck %s -DFILE=%t.phdr.err2 --check-prefix=WARN-PHOFF-LLVM -DOFF=0x161
+# WARN-PHOFF-GNU: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: program headers are longer than binary of size 408: e_phoff = [[OFF]], e_phnum = 1, e_phentsize = 56
# WARN-PHOFF-GNU: Program Headers:
# WARN-PHOFF-GNU-NEXT: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
-# WARN-PHOFF-GNU-NEXT: warning: '[[FILE]]': unable to dump program headers: program headers are longer than binary of size 408: e_phoff = [[OFF]], e_phnum = 1, e_phentsize = 56
# WARN-PHOFF-GNU: Section to Segment mapping:
# WARN-PHOFF-GNU-NEXT: Segment Sections...
-# WARN-PHOFF-GNU-NEXT: warning: '[[FILE]]': can't read program headers to build section to segment mapping: program headers are longer than binary of size 408: e_phoff = [[OFF]], e_phnum = 1, e_phentsize = 56
+# WARN-PHOFF-LLVM: warning: '[[FILE]]': unable to read program headers to locate the PT_DYNAMIC segment: program headers are longer than binary of size 408: e_phoff = [[OFF]], e_phnum = 1, e_phentsize = 56
# WARN-PHOFF-LLVM: ProgramHeaders [
-# WARN-PHOFF-LLVM-NEXT: warning: '[[FILE]]': unable to dump program headers: program headers are longer than binary of size 408: e_phoff = [[OFF]], e_phnum = 1, e_phentsize = 56
# WARN-PHOFF-LLVM-NEXT: ]
## Check we report a warning when the value of e_phoff is so large that
diff --git a/llvm/test/tools/llvm-readobj/ELF/relocation-errors.test b/llvm/test/tools/llvm-readobj/ELF/relocation-errors.test
index 87aab76de4c29..1bd607abb49a5 100644
--- a/llvm/test/tools/llvm-readobj/ELF/relocation-errors.test
+++ b/llvm/test/tools/llvm-readobj/ELF/relocation-errors.test
@@ -7,7 +7,6 @@
# LLVM: Relocations [
# LLVM-NEXT: Section (3) .rel.text {
# LLVM-NEXT: warning: '[[FILE]]': unable to print relocation 0 in SHT_REL section with index 3: unable to read an entry with index 4278124286 from SHT_SYMTAB section with index 6: can't read an entry at 0x17e7e7e7d0: it goes past the end of the section (0x90)
-# LLVM-NEXT: warning: '[[FILE]]': unable to print relocation 1 in SHT_REL section with index 3: unable to read an entry with index 4278124286 from SHT_SYMTAB section with index 6: can't read an entry at 0x17e7e7e7d0: it goes past the end of the section (0x90)
# LLVM-NEXT: 0x2 R_X86_64_NONE -{{$}}
# LLVM-NEXT: 0x3 R_X86_64_NONE .sec.symbol1{{$}}
# LLVM-NEXT: warning: '[[FILE]]': invalid section index: 255
@@ -24,7 +23,6 @@
# GNU: Relocation section '.rel.text' at offset 0x41 contains 7 entries:
# GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name
# GNU-NEXT: warning: '[[FILE]]': unable to print relocation 0 in SHT_REL section with index 3: unable to read an entry with index 4278124286 from SHT_SYMTAB section with index 6: can't read an entry at 0x17e7e7e7d0: it goes past the end of the section (0x90)
-# GNU-NEXT: warning: '[[FILE]]': unable to print relocation 1 in SHT_REL section with index 3: unable to read an entry with index 4278124286 from SHT_SYMTAB section with index 6: can't read an entry at 0x17e7e7e7d0: it goes past the end of the section (0x90)
# GNU-NEXT: 0000000000000002 0000000000000000 R_X86_64_NONE
# GNU-NEXT: 0000000000000003 0000000200000000 R_X86_64_NONE 0000000000000000 .sec.symbol1
# GNU-NEXT: warning: '[[FILE]]': invalid section index: 255
@@ -43,7 +41,6 @@
# CREL-GNU: Relocation section '.rel.text' at offset 0x41 contains 7 entries:
# CREL-GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
# CREL-GNU-NEXT: warning: '[[FILE]]': unable to print relocation 0 in SHT_CREL section with index 3: unable to read an entry with index 4278124286 from SHT_NULL section with index 0: section [index 0] has invalid sh_entsize: expected 24, but got 0
-# CREL-GNU-NEXT: warning: '[[FILE]]': unable to print relocation 1 in SHT_CREL section with index 3: unable to read an entry with index 4278124286 from SHT_NULL section with index 0: section [index 0] has invalid sh_entsize: expected 24, but got 0
# CREL-GNU-NEXT: 0000000000000002 0000000000000000 R_X86_64_NONE 0
# CREL-GNU-NEXT: warning: '[[FILE]]': unable to print relocation 3 in SHT_CREL section with index 3: unable to read an entry with index 2 from SHT_NULL section with index 0: section [index 0] has invalid sh_entsize: expected 24, but got 0
# CREL-GNU-NEXT: warning: '[[FILE]]': unable to print relocation 4 in SHT_CREL section with index 3: unable to read an entry with index 4 from SHT_NULL section with index 0: section [index 0] has invalid sh_entsize: expected 24, but got 0
diff --git a/llvm/test/tools/llvm-readobj/ELF/relocations.test b/llvm/test/tools/llvm-readobj/ELF/relocations.test
index 34cff4098514d..ef832f79b8990 100644
--- a/llvm/test/tools/llvm-readobj/ELF/relocations.test
+++ b/llvm/test/tools/llvm-readobj/ELF/relocations.test
@@ -360,7 +360,6 @@ Symbols:
# BROKEN-REL-GNU: Relocation section '.rel.text' at offset 0x51 contains 64 entries:
# BROKEN-REL-GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name
-# BROKEN-REL-GNU-NEXT: warning: '[[FILE]]': unable to read relocations from SHT_REL section with index 2: section [index 2] has invalid sh_entsize: expected 1...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/191708
More information about the llvm-branch-commits
mailing list