PR binutils/3535
authorNick Clifton <nickc@redhat.com>
Tue, 20 Mar 2007 12:18:18 +0000 (12:18 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 20 Mar 2007 12:18:18 +0000 (12:18 +0000)
* elf.c (copy_private_bfd_data): Widen the scope of Solaris specific
  conditions that need the program headers to be rewritten.

bfd/ChangeLog
bfd/elf.c

index 07946e6bd6ed8567600fc710a3036fe6a1adb27e..7c7ae135fe951ea511f18ca0401139e00cb1be07 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-20  Nick Clifton  <nickc@redhat.com>
+
+       PR binutils/3535
+       * elf.c (copy_private_bfd_data): Widen the scope of Solaris
+       specific conditions that need the program headers to be
+       rewritten.
+
 2003-03-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic,
index 05d45e1058c0d47814418575830921595dd4dc42..0a6eaa0b1d918882ecd0bedbdf7842b3e1fb9313 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5915,21 +5915,15 @@ copy_private_bfd_data (bfd *ibfd, bfd *obfd)
           i < num_segments;
           i++, segment++)
        {
-         /* This is a different version of the IS_SOLARIS_PT_INTERP
-            macro to the one defined in rewrite_elf_program_header().  */
-#define IS_SOLARIS_PT_INTERP(p)                        \
-  (p->p_type == PT_INTERP                      \
-   && p->p_vaddr == 0                          \
-   && p->p_paddr == 0                          \
-   && p->p_memsz == 0                          \
-   && p->p_filesz > 0)
-         /* PR binutils/3535.  The Solaris interpreter program header
-            needs special treatment, so we always rewrite the headers
-            when one is detected.  */
-         if (IS_SOLARIS_PT_INTERP (segment))
+         /* PR binutils/3535.  The Solaris linker always sets the p_paddr
+            and p_memsz fields of special segments (DYNAMIC, INTERP) to 0
+            which severly confuses things, so always regenerate the segment
+            map in this case.  */
+         if (segment->p_paddr == 0
+             && segment->p_memsz == 0
+             && (segment->p_type == PT_INTERP || segment->p_type == PT_DYNAMIC))
            goto rewrite;
-         
+
          for (section = ibfd->sections;
               section != NULL; section = section->next)
            {
This page took 0.029596 seconds and 4 git commands to generate.