This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Objcopy fix for relocation sections
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Tue, 23 Dec 2003 13:51:37 +1030
- Subject: Re: Objcopy fix for relocation sections
- References: <20031222210543.GA3418@nevyn.them.org>
On Mon, Dec 22, 2003 at 04:05:44PM -0500, Daniel Jacobowitz wrote:
> I got a bug report that objcopy failed for shared libraries with "File
> truncated" on arm-linux. The problem was that ARM keeps relocations for
> debug information, and objcopy never arranged for
> elf.c:assign_file_position_for_relocs to be called. This patch was the best
> solution I could come up with - is it OK?
>
> * elf.c (_bfd_elf_set_section_contents): If a relocation section
> does not have an offset, assign one.
I can't say I like it particularly. I think it would be better to
set the file offsets for relocs in assign_file_positions_except_relocs.
I know that goes against the name of the function, but we set offsets
for .rela.dyn and other loaded reloc sections in executables and
shared libs there anyway..
--
Alan Modra
IBM OzLabs - Linux Technology Centre