PR ld/10744
authorAlan Modra <amodra@gmail.com>
Thu, 8 Oct 2009 01:00:27 +0000 (01:00 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 8 Oct 2009 01:00:27 +0000 (01:00 +0000)
* ldlang.c (lang_new_phdr): Allow FILEHDR/PHDRS on more than the
first PT_LOAD header.
* ld.texinfo: Update.

ld/ChangeLog
ld/ld.texinfo
ld/ldlang.c

index fe15c36d17c5030d2d92e9a04e889996f01b1a3a..5ed952e0a9ee7aa9d6003b7fc3348ecca393dcf8 100644 (file)
@@ -1,3 +1,10 @@
+2009-10-08  Alan Modra  <amodra@bigpond.net.au>
+
+       PR ld/10744
+       * ldlang.c (lang_new_phdr): Allow FILEHDR/PHDRS on more than the
+       first PT_LOAD header.
+       * ld.texinfo: Update.
+
 2009-10-06  Nathan Sidwell  <nathan@codesourcery.com>
 
        * ldlang.c (lang_new_phdr): Check PHDRS and FILEHDR in loadable
index 978ae669f1eff88b7cb7720876f331409ece644e..21ff9cd62990a8e366fb6d8b37660348bd9033d4 100644 (file)
@@ -4740,7 +4740,8 @@ the program header type to further describe the contents of the segment.
 The @code{FILEHDR} keyword means that the segment should include the ELF
 file header.  The @code{PHDRS} keyword means that the segment should
 include the ELF program headers themselves.  If applied to a loadable
-segment (@code{PT_LOAD}), it must be the first loadable segment.
+segment (@code{PT_LOAD}), all prior loadable segments must have one of
+these keywords.
 
 The @var{type} may be one of the following.  The numbers indicate the
 value of the keyword.
index a46438ed8ee388d53b1dd3d106a6a895e732a20e..f1daeb57113a45ad38366369f09d7b3a892a316e 100644 (file)
@@ -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;
       }
 
This page took 0.034434 seconds and 4 git commands to generate.