[llvm] [ObjectYAML][ELF] Report incorrect offset to generate notes (PR #118741)

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 20:54:35 PST 2024


================
@@ -514,3 +514,58 @@ Sections:
         Desc: 030405
       - Name: GNU
         Type: NT_GNU_BUILD_ID
+
+## Check that an incorrect offset for generating notes is reported.
+
+# RUN: not yaml2obj --docnum=19 %s 2>&1 | FileCheck %s --check-prefix=ERR_OFFSET
+# ERR_OFFSET: error: .note: invalid offset of a note section: 0x{{.*}}, should be aligned to 4
+
+--- !ELF
+FileHeader:
+  Class: ELFCLASS32
+  Data:  ELFDATA2LSB
+  Type:  ET_EXEC
+Sections:
+  - Name: .dummy
+    Type: SHT_PROGBITS
+    Size: 1
+  - Name: .note
+    Type: SHT_NOTE
+    Notes:
----------------
igorkudrin wrote:

Thanks! Fixed

https://github.com/llvm/llvm-project/pull/118741


More information about the llvm-commits mailing list