From: Nick Clifton Date: Tue, 20 Mar 2007 12:18:18 +0000 (+0000) Subject: PR binutils/3535 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f6999aa009f62f2fa2c4a0be7eb50e84aedbaac;p=binutils-gdb.git PR binutils/3535 * elf.c (copy_private_bfd_data): Widen the scope of Solaris specific conditions that need the program headers to be rewritten. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 07946e6bd6e..7c7ae135fe9 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2007-03-20 Nick Clifton + + 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 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Store Magic, diff --git a/bfd/elf.c b/bfd/elf.c index 05d45e1058c..0a6eaa0b1d9 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) {