You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
binutils/SOURCES/binutils-relro-padding.patch

16 lines
877 B

--- binutils.orig/bfd/elf.c 2024-07-25 09:01:36.091804849 +0100
+++ binutils-2.35.2/bfd/elf.c 2024-07-25 09:02:22.645006725 +0100
@@ -2759,6 +2759,12 @@ static const struct bfd_elf_special_sect
{ STRING_COMMA_LEN (".rodata"), -2, SHT_PROGBITS, SHF_ALLOC },
{ STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC },
{ STRING_COMMA_LEN (".rela"), -1, SHT_RELA, 0 },
+ /* .relro_padding is generated by lld. It should not be confused with a
+ reloc containing section, because otherwise elf_fake_sections() will
+ set the entsize to 8, which may not be an actual multiple of the
+ section's size.
+ Note - this entry must appear before the ".rel" entry below. */
+ { STRING_COMMA_LEN (".relro_padding"), 0, SHT_NOBITS, SHF_ALLOC | SHF_WRITE },
{ STRING_COMMA_LEN (".rel"), -1, SHT_REL, 0 },
{ NULL, 0, 0, 0, 0 }
};