]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elflint: Recognize .relro_padding section
authorMark Wielaard <mark@klomp.org>
Mon, 9 Feb 2026 22:19:17 +0000 (23:19 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 17 Feb 2026 12:36:56 +0000 (13:36 +0100)
lld might generate a .relro_padding section, it should be WRITE|ALLOC
to be part of PT_GNU_TLS.

 * src/elflint.c (special_sections): Add .relro_padding.

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

index daa9410d20d9d02d8a5aaa41584cf3b3ed7969a1..f47593dfb9849bdca33717d24c39fadb29497ca4 100644 (file)
@@ -3703,6 +3703,10 @@ static const struct
     { ".plt", 5, SHT_PROGBITS, unused, 0, 0 }, // XXX more tests
     { ".preinit_array", 15, SHT_PREINIT_ARRAY, exact, SHF_ALLOC | SHF_WRITE, 0 },
     { ".rela", 5, SHT_RELA, atleast, 0, SHF_ALLOC | SHF_INFO_LINK }, // XXX more tests
+
+    /* lld extension.  Added before relr so it doesn't match that entry.  */
+    { ".relro_padding", 15, SHT_NOBITS, exact, SHF_ALLOC | SHF_WRITE, 0 },
+
     { ".relr", 5, SHT_RELR, atleast, 0, SHF_ALLOC }, // XXX more tests
     { ".rel", 4, SHT_REL, atleast, 0, SHF_ALLOC | SHF_INFO_LINK }, // XXX more tests
     { ".rodata", 8, SHT_PROGBITS, atleast, SHF_ALLOC, SHF_MERGE | SHF_STRINGS },