This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Objcopy fix for relocation sections
- From: Daniel Jacobowitz <drow at false dot org>
- To: binutils at sources dot redhat dot com
- Date: Thu, 9 Sep 2004 12:39:04 -0400
- Subject: Re: Objcopy fix for relocation sections
- References: <20031222210543.GA3418@nevyn.them.org> <20031223032137.GD1618@bubble.sa.bigpond.net.au> <20040727210426.GA11595@nevyn.them.org> <20040803225601.GA22637@nevyn.them.org> <20040805092703.GF12879@bubble.modra.org> <20040805131429.GA14075@nevyn.them.org> <20040907235700.GL22095@bubble.modra.org>
On Wed, Sep 08, 2004 at 09:27:00AM +0930, Alan Modra wrote:
> After having a good look at what is going on here, I believe the
> following patch is the correct solution. Would you please check
> that it fixes the original problem? I tested that this change
> cures a similar problem on powerpc-linux (at least the FSF version,
> where we output debug relocs). Prior to this patch, using a .so
> created during the ld testsuite run, I get
>
> $ ../../binutils/objcopy vp.so xxx.so
> ../../binutils/objcopy: xxx.so: File truncated
>
> As the comment I added says, some reloc sections are not handled
> specially by bfd (see bfd_section_from_shdr). These should be
> treated as normal bfd sections.
>
> * elf.c (assign_file_positions_except_relocs): Assign relocs
> stored in a bfd section.
Thanks! Your explanation makes sense, and this also works for my test
cases.
--
Daniel Jacobowitz