Objcopy fix for relocation sections

Alan Modra amodra@bigpond.net.au
Tue Dec 23 09:12:00 GMT 2003
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



More information about the Binutils mailing list