aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-03-20 12:18:18 +0000
committerNick Clifton <nickc@redhat.com>2007-03-20 12:18:18 +0000
commit5f6999aa009f62f2fa2c4a0be7eb50e84aedbaac (patch)
tree726f56cfb56f345cfa4254276501af8e36ddbc14 /bfd/elf.c
parent417f79e9ac3eca8c7db15af65d7ef6f11eda0e6d (diff)
downloadgdb-5f6999aa009f62f2fa2c4a0be7eb50e84aedbaac.zip
gdb-5f6999aa009f62f2fa2c4a0be7eb50e84aedbaac.tar.gz
gdb-5f6999aa009f62f2fa2c4a0be7eb50e84aedbaac.tar.bz2
PR binutils/3535
* elf.c (copy_private_bfd_data): Widen the scope of Solaris specific conditions that need the program headers to be rewritten.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 05d45e1..0a6eaa0 100644
--- 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)
{