From 4100cea361e40b86953629f28dcab4d8d12d5fbe Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 8 Oct 2009 01:00:27 +0000 Subject: PR ld/10744 * ldlang.c (lang_new_phdr): Allow FILEHDR/PHDRS on more than the first PT_LOAD header. * ld.texinfo: Update. --- ld/ldlang.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ld/ldlang.c') 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; } -- cgit v1.1