aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2021-11-17 15:59:16 +0000
committerNick Clifton <nickc@redhat.com>2021-11-17 15:59:16 +0000
commitee9e412f14908c1055cb00fab9307d1723981639 (patch)
tree4a5ba4638187d448bac46a3444a372ae0bb20922 /bfd
parent0df670bbe009d3b57f5dbf9599913ad06013ec4e (diff)
downloadgdb-ee9e412f14908c1055cb00fab9307d1723981639.zip
gdb-ee9e412f14908c1055cb00fab9307d1723981639.tar.gz
gdb-ee9e412f14908c1055cb00fab9307d1723981639.tar.bz2
Fix the linker script parser so that it will recognise the PT_GNU_RELRO segment type, and the linker itself so that it will gracefully handle being unable to assign any sections to such a segment.
PR 28452 bfd * elf.c (assign_file_positions_for_non_load_sections): Replace assertion with a warning message. ld * ldgram.y: Add support for PT_GNU_RELRO and PT_GNU_PROPERTY. * ldgram.c: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d539dbb..35b659b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2021-11-17 Nick Clifton <nickc@redhat.com>
+
+ PR 28452
+ * elf.c (assign_file_positions_for_non_load_sections): Replace
+ assertion with a warning message.
+
2021-10-19 Nick Clifton <nickc@redhat.com>
* linker.c (_bfd_generic_link_add_one_symbol): Test for a NULL
diff --git a/bfd/elf.c b/bfd/elf.c
index 79231e2..cfdb949 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -6261,10 +6261,15 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
}
}
}
- if (link_info != NULL)
- BFD_ASSERT (ok);
+
if (!ok)
- memset (p, 0, sizeof *p);
+ {
+ if (link_info != NULL)
+ _bfd_error_handler
+ (_("%pB: warning: unable to allocate any sections to PT_GNU_RELRO segment"),
+ abfd);
+ memset (p, 0, sizeof *p);
+ }
}
else if (p->p_type == PT_GNU_STACK)
{