This is the mail archive of the
mailing list for the binutils project.
Re: about relocation of split symbols
- From: Alan Modra <amodra at gmail dot com>
- To: Aurelien Buhrig <aurelien dot buhrig dot gcc at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 1 Jul 2011 09:59:00 +0930
- Subject: Re: about relocation of split symbols
- References: <BANLkTi=reOEzFhJLfX4XmSY-=nBknWqoww@mail.gmail.com>
On Thu, Jun 30, 2011 at 03:58:06PM +0200, Aurelien Buhrig wrote:
> My guess is that some instructions (such as "la" instruction) are
> transformed by the assembly into 2 instructions loading both 16-bit
> parts of the 32-bit address (or more for 64-bit addresses). Right?
Yes, except that you should think long and hard before implementing
magic transformations in the assembler. It's probably better to keep
the assembler simple, ie. just provide the underlying hardware
> So 2 additional HOWTOs must be defined for LD to know how to relocate
> both parts, right ?
Yes. See powerpc R_PPC_ADDR16_LO, R_PPC_ADDR16_HI, R_PPC_ADDR16_HA
and many more like these. The difference between the HI and HA relocs
is that the former is used in code that ors in the low part of the
address, the latter is used when you add the low part with an
instruction that treats its 16-bit immediate as signed.
Australia Development Lab, IBM