]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elflint, readelf, support SHT_LLVM_LTO and SHT_LLVM_ADDRSIG
authorMark Wielaard <mark@klomp.org>
Mon, 9 Feb 2026 22:18:40 +0000 (23:18 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 17 Feb 2026 12:36:10 +0000 (13:36 +0100)
An SHT_LLVM_LTO section contains LLVM bitcode. An SHT_LLVM_ADDRSIG
section contains ULEB128 integers referring to the symbol table
indexes of address-significant symbols. This patch just recognizes the
SHT constants but doesn't handle the section contents.

 * libebl/eblsectiontypename.c (ebl_section_type_name):
 Recognize SHT_LLVM_ADDRSIG and SHT_LLVM_LTO.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libebl/eblsectiontypename.c

index ade25d4a570145acafbdba2d913d1babadadd54d..5b64a1e29646633a98d63020b25e214cec8eb3ae 100644 (file)
@@ -102,6 +102,22 @@ ebl_section_type_name (Ebl *ebl, int section, char *buf, size_t len)
            res = "GNU_ATTRIBUTES";
            break;
 
+       /* A few LLVM additions.  */
+
+#ifndef SHT_LLVM_ADDRSIG
+#define SHT_LLVM_ADDRSIG 0x6fff4c03
+#endif
+         case SHT_LLVM_ADDRSIG:
+           res = "LLVM_ADDRSIG";
+           break;
+
+#ifndef SHT_LLVM_LTO
+#define SHT_LLVM_LTO 0x6fff4c0c
+#endif
+         case SHT_LLVM_LTO:
+           res = "LLVM_LTO";
+           break;
+
          default:
            /* Handle OS-specific section names.  */
            if (section >= SHT_LOOS && section <= SHT_HIOS)