[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
Tue Nov 12 04:02:32 PST 2024
================
@@ -0,0 +1,25 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objdump -p %t 2>&1 | FileCheck --check-prefix=BROKEN-VERDEF -DFILE=%t %s
+
+## Ensure we emit a warning when vd_aux offset field is invalid.
+
+# BROKEN-VERDEF: Version definitions:
+# BROKEN-VERDEF-NEXT: warning: '[[FILE]]': corrupted section: vd_aux value 69 in section verdef points past end of the section
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+Sections:
+ - Name: .gnu.version_d
+ Type: SHT_GNU_verdef
+ Entries:
+ - Version: 1
+ Flags: 0
+ VersionNdx: 0
+ VDAux: 69
----------------
jh7370 wrote:
This still could do with a comment saying how it's invalid (i.e. what it should be).
https://github.com/llvm/llvm-project/pull/115284
More information about the llvm-commits
mailing list