[llvm] [llvm-objdump][ELF] Ensure offset to verdaux entry array does not go past size (PR #115284)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 04:58:02 PST 2024
================
@@ -0,0 +1,29 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objdump -p %t 2>&1 | FileCheck --check-prefix=BROKEN-VERDEF -DFILE=%t %s
+
+# BROKEN-VERDEF: Version definitions:
+# BROKEN-VERDEF-NEXT: warning: '[[FILE]]': out-of-bound while parsing verdaux entries, corrupted verdef section
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_X86_64
+ Entry: 0x0000000000001000
+Sections:
+ - Name: .gnu.version_d
+ Type: SHT_GNU_verdef
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000000230
+ AddressAlign: 0x0000000000000004
+ Entries:
+ - Version: 1
+ Flags: 44
+ VersionNdx: 0
+ Hash: 12345
----------------
jh7370 wrote:
To reduce the verbosity of the test, I'd omit as many fields as I can. I believe the Flags/Address/AddressAlign fields for the section, and the majority of these values in this Entry are unnecessary for the test. This will help make it clearer what is specifically being tested.
https://github.com/llvm/llvm-project/pull/115284
More information about the llvm-commits
mailing list