compiling binutils with -DDEBUG

Alan Modra amodra@bigpond.net.au
Wed Mar 2 02:40:00 GMT 2005


On Tue, Mar 01, 2005 at 08:40:37PM -0500, Ian Lance Taylor wrote:
> Alan Modra <amodra@bigpond.net.au> writes:
> 
> > >  If the assert in fixup_segment() fails, then
> > > MRI common symbols will not be handled correctly.
> > 
> > Are you sure?  I couldn't see why it mattered that the sym was resolved
> > at write.c:1857 versus being resolved at write.c:2588.  The mri common
> > testcase looks to produce good results.
> 
> A relocation against a symbol in an MRI common section has to be
> converted into a relocation against the MRI common symbol with the
> appropriate addend.  That is what the code in fixup_segment is doing.

Understood.  The relocs appear correct to me.  ie. resolve_symbol_value
is doing the right thing, I think.

dump.o:     file format elf32-m68k

RELOCATION RECORDS FOR [.data]:
OFFSET   TYPE              VALUE
00000000 R_68K_32          com1
00000004 R_68K_32          00com2+0x00000004

dump.o:     file format a.out-zero-big

RELOCATION RECORDS FOR [.data]:
OFFSET   TYPE              VALUE
00000000 32                com1
00000004 32                00com2

dump.o:     file format coff-m68k

RELOCATION RECORDS FOR [.data]:
OFFSET   TYPE              VALUE
00000000 32                com1
00000004 32                00com2

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list