aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
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;
}