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.
This commit is contained in:
parent
0df670bbe0
commit
ee9e412f14
@ -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
|
||||
|
@ -6261,11 +6261,16 @@ assign_file_positions_for_non_load_sections (bfd *abfd,
|
||||
}
|
||||
}
|
||||
}
|
||||
if (link_info != NULL)
|
||||
BFD_ASSERT (ok);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if (m->p_size_valid)
|
||||
|
@ -1,3 +1,9 @@
|
||||
2021-11-17 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR 28452
|
||||
* ldgram.y: Add support for PT_GNU_RELRO and PT_GNU_PROPERTY.
|
||||
* ldgram.c: Regenerate.
|
||||
|
||||
2021-11-15 Roland McGrath <mcgrathr@google.com>
|
||||
|
||||
* testsuite/ld-aarch64/dt_textrel.d: Pass explicit -z notext in
|
||||
|
@ -1262,6 +1262,10 @@ phdr_type:
|
||||
$$ = exp_intop (0x6474e550);
|
||||
else if (strcmp (s, "PT_GNU_STACK") == 0)
|
||||
$$ = exp_intop (0x6474e551);
|
||||
else if (strcmp (s, "PT_GNU_RELRO") == 0)
|
||||
$$ = exp_intop (0x6474e552);
|
||||
else if (strcmp (s, "PT_GNU_PROPERTY") == 0)
|
||||
$$ = exp_intop (0x6474e553);
|
||||
else
|
||||
{
|
||||
einfo (_("\
|
||||
|
Loading…
x
Reference in New Issue
Block a user