This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: bug in .eh_frame_hdr processing
Alan Modra writes:
> On Sun, Feb 23, 2003 at 11:01:01AM +0000, Andrew Haley wrote:
> > Richard Henderson writes:
> > > On Sat, Feb 22, 2003 at 08:11:54PM +0000, Andrew Haley wrote:
> > > > Alternatively, perhaps we shouldn't do this optimization at all when
> > > > generating relocateable output, but instead postpone it until final
> > > > link.
> > >
> > > I'd prefer this.
> >
> > Me too. It's simpler, and safer.
>
> Yes, given that this is at least the second ld -r problem found in the
> eh_frame editing code, I think I made a mistake in enabling the
> optimization for ld -r. It wouldn't hurt to commit your fix though.
Jakub sent me this patch in email:
2003-02-27 Jakub Jelinek <jakub at redhat dot com>
Andrew Haley <aph at redhat dot com>
* elflink.h (elf_bfd_discard_info): Don't process eh frames if
output is relocateable.
Index: elflink.h
===================================================================
RCS file: /cvs/src/src/bfd/elflink.h,v
retrieving revision 1.206
diff -c -2 -p -r1.206 elflink.h
*** elflink.h 17 Feb 2003 18:24:40 -0000 1.206
--- elflink.h 27 Feb 2003 17:58:30 -0000
*************** elf_bfd_discard_info (output_bfd, info)
*** 8329,8335 ****
eh = bfd_get_section_by_name (abfd, ".eh_frame");
! if (eh != NULL
! && (eh->_raw_size == 0
! || bfd_is_abs_section (eh->output_section)))
eh = NULL;
--- 8329,8336 ----
eh = bfd_get_section_by_name (abfd, ".eh_frame");
! if (info->relocateable
! || (eh != NULL
! && (eh->_raw_size == 0
! || bfd_is_abs_section (eh->output_section))))
eh = NULL;
*************** elf_bfd_discard_info (output_bfd, info)
*** 8432,8435 ****
--- 8433,8437 ----
if (info->eh_frame_hdr
+ && !info->relocateable
&& _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
ret = TRUE;