relocations with addenda

Corey Schuhen corey_schuhen@BEELINE.ag
Wed Oct 23 15:01:00 GMT 2002


Nick,

Thank you for your reply.  We thought this may be the case. Is it required for 
use to port both LD and GAS? It seemed to me from some comments in the LD 
source code that it reads in the input object files and stores them (in RAM) 
in a format-neutral way. It would seem to me that if LD is changed to output 
RELA then it does not matter that its inputs are in REL.

Thanks

Corey



On Wed, 23 Oct 2002 08:30 pm, Nick Clifton wrote:
> Hi Stuart,
>
> > I am attempting to compile a simple program on my i386 machine for an ARM
> > target.  In doing this, GCC produces a relocation section in its output
> > file (.rel.text).  ld then produces a .rel.text segment in its output
> > when run with the --emit-relocs option.  This relocation section is of
> > the no-addenda variety and is incompatible with the system on which I am
> > attempting to run my program.  Said system requires a .rela.text section
> > for its relocations (i.e. one with addenda values).
> >
> > ld doesn't seem to have a run-time option for converting the .rel.text
> > sections of its input to .rela.text sections in its output.  Is there any
> > way to enable such a conversion?
>
> Unfortunately no.  The ARM port of LD gas GAS use REL type relocations
> which store the addend in the instruction.  What you need is a port
> that uses RELA relocations where the addend is stored in a separate
> field in the relocation structure itself.
>
> > Can one adjust or patch the source code to accomplish this?
>
> This is possible, although it would probably take a lot of testing to
> make sure that it was done correctly.  Feel free to try however.
> There are a lot of other ports of GAS and LD that use RELA type
> relocations so you can look at these for examples of what needs to be
> done.
>
> Cheers
>         Nick

-- 
Corey Schuhen,
Software Engineer,
B Eng ME (Hons), B InfTech

BEELINE Technologies R&D
305 Montague Road,
West End 4101
Ph:     07 3004 6716

#####################################################################################
Note:
This message is for the named person's use only.  It may contain confidential,
proprietary or legally privileged information.  No confidentiality or privilege
is waived or lost by any mistransmission.  If you receive this message in error,
please immediately delete it and all copies of it from your system, destroy any
hard copies of it and notify the sender.  You must not, directly or indirectly,
use, disclose, distribute, print, or copy any part of this message if you are not
the intended recipient. BEELINE Technologies and any of its subsidiaries each reserve
the right to monitor all e-mail communications through its networks.

Any views expressed in this message are those of the individual sender, except where
the message states otherwise and the sender is authorized to state them to be the
views of any such entity.

Thank You.
postmaster@BEELINE.ag
#####################################################################################



More information about the Binutils mailing list