aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-10-08 01:00:27 +0000
committerAlan Modra <amodra@gmail.com>2009-10-08 01:00:27 +0000
commit4100cea361e40b86953629f28dcab4d8d12d5fbe (patch)
tree1f897c573ce56d238e76c2b86bde3e7e272f618d /ld/ldlang.c
parent092004b4862f5b5f1c5d50be14ffb062d92d5fbb (diff)
downloadgdb-4100cea361e40b86953629f28dcab4d8d12d5fbe.zip
gdb-4100cea361e40b86953629f28dcab4d8d12d5fbe.tar.gz
gdb-4100cea361e40b86953629f28dcab4d8d12d5fbe.tar.bz2
PR ld/10744
* ldlang.c (lang_new_phdr): Allow FILEHDR/PHDRS on more than the first PT_LOAD header. * ld.texinfo: Update.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index a46438e..f1daeb5 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -6779,9 +6779,11 @@ lang_new_phdr (const char *name,
hdrs = n->type == 1 && (phdrs || filehdr);
for (pp = &lang_phdr_list; *pp != NULL; pp = &(*pp)->next)
- if (hdrs && (*pp)->type == 1)
+ if (hdrs
+ && (*pp)->type == 1
+ && !((*pp)->filehdr || (*pp)->phdrs))
{
- einfo (_("%X%P:%S: PHDRS and FILEHDR are only permitted for the first PT_LOAD segment\n"));
+ einfo (_("%X%P:%S: PHDRS and FILEHDR are not supported when prior PT_LOAD headers lack them\n"));
hdrs = FALSE;
}