Finding BFD bug

Nick Clifton nickc@redhat.com
Wed Jun 9 16:54:00 GMT 2004


Hi Peter,

> main.s (again, only the data section shown):
> 
> global test2
> 
> data
> test2:
>   .data32 test
>   .data32 test+4
>   .data32 test+8
> 
> After using gas and linking, we get the same problem:  test2 contains
> {test, test+8, test+16}.  If we merge the two assembly files, the problem
> goes away.  This screams at us as a linker problem.

First step - check the relocs in the object file.  (eg using "objdump 
-dr").  If the relocs have +8 and +16 in them then it is an assembler 
bug rather than a linker bug.

> To eliminate a general linker error, we took the same code to a Linux box running the same version
> of binutils.  In fact, we took the Xilinx modified source and configured
> for i686-linux-gnu.  The problem does not appear when using the x86
> version.  Seems to us when linking external symbols, the offsets get
> broken.

If the relocs contain +4 and +8 then have a look for a file in the 
sources called something like bfd/elf32-xilinix.c o or 
bfd/elf32-microblaze.c.  This will/should contain the Xilinix specific 
code that is probably causing the problem.  Look for a function with 
"final_link_relocate" as part of its name.  This is probably where the 
bug can be found.

Cheers
   Nick




More information about the Binutils mailing list