This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Relocation question (was: RE: Unsupported targets slated for removal)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Christian Groessler <chris at groessler dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 6 Apr 2005 22:16:32 +0930
- Subject: Re: Relocation question (was: RE: Unsupported targets slated for removal)
- References: <Pine.LNX.4.30.0504061213280.1393-100000@ds9.groessler.org>
On Wed, Apr 06, 2005 at 12:23:47PM +0200, Christian Groessler wrote:
> > ----- Alan Modra wrote -----
> > On Tue, Mar 22, 2005 at 06:08:30PM +0100, Christian Groessler wrote:
> > > > z8k-*-* Christian, please update z8k to use bfd!
> > >
> > > Is there a guide how to do this somewhere, or should I simply start
> > > defining BFD_ASSEMBLER and then fix what breaks...
> >
> > Yes, set bfd_gas=yes in configure.tgt, then fix what breaks. Compare
> > target object files before and after..
Actually, I probably should have mentioned that the critical thing is
that after final linking you get the same result.
> While doing this I've encountered the following problem. Consider this
> source file:
>
> .text
> .long INITFN
> INITFN: nop
>
>
>
> If I compile it with the old assembler, I get the following relocation
> entry in the object file:
>
>
> /tmp/yyy.o: file format coff-z8k
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000000 r_imm32 INITFN
>
>
> If I compile it with my BFD_ASSEMBLER modified version, I get
>
>
> /tmp/zzz.o: file format coff-z8k
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET TYPE VALUE
> 00000000 r_imm32 .text
>
>
> Please note the different VALUEs.
Either of these is likely OK. In the second case, a reloc against a
local symbol INITFN is being reduced to a reloc against a section
symbol. With larger assembly files this optimization can reduce the
size of the symbol table. You can tweak which relocs may be reduced
with tc_fix_adjustable.
--
Alan Modra
IBM OzLabs - Linux Technology Centre