aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2024-07-24 14:47:51 +0100
committerNick Clifton <nickc@redhat.com>2024-07-24 14:47:51 +0100
commit88141209e25ce19473ec07d7aac09cc68f06a630 (patch)
tree5f530bd27cd966da93b38037380f3c9886c85fc4
parentb0056f89497ce28e88b275250099d4fab0999c0a (diff)
downloadgdb-88141209e25ce19473ec07d7aac09cc68f06a630.zip
gdb-88141209e25ce19473ec07d7aac09cc68f06a630.tar.gz
gdb-88141209e25ce19473ec07d7aac09cc68f06a630.tar.bz2
BFD: Add .relro_padding to list of special sections
-rw-r--r--bfd/elf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index f85f79e..bc4a2de 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3064,6 +3064,12 @@ static const struct bfd_elf_special_section special_sections_r[] =
{ STRING_COMMA_LEN (".rodata1"), 0, SHT_PROGBITS, SHF_ALLOC },
{ STRING_COMMA_LEN (".relr.dyn"), 0, SHT_RELR, 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 }
};