This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Binutils 2.28 on PowerPC: dangerous relocation: generic linker can't handle R_PPC_SECTOFF_HA
On Fri, May 17, 2019 at 07:20:39AM +0200, Sebastian Huber wrote:
> On 16/05/2019 16:05, Alan Modra wrote:
> > My point was that sym@sectoff@l and sym@sectoff@ha are exactly the
> > same as sym@l and sym@ha respectively when sym is SHN_ABS. It's fine
> > to use @sectoff with symbols for addresses within output sections, but
> > symbols representing the size of multiple output sections really
> > shouldn't be @sectoff.
>
> The problem is that if I change it to sym@ha and sym@l, then I get this
> assembler error:
>
> lis r3,__size@ha
> addi r3,r3,__size@l
>
> bsps/powerpc/motorola_powerpc/bootloader/head.S: Assembler messages:
> bsps/powerpc/motorola_powerpc/bootloader/head.S:151: Error: relocation
> cannot be done when using -mrelocatable
> bsps/powerpc/motorola_powerpc/bootloader/head.S:152: Error: relocation
> cannot be done when using -mrelocatable
Hmm, that's the first I knew you were assembling with -mrelocatable
(or noticed, if you said so). Oh well, that makes my comment about
@sectoff wrong. Looks like you should continue using @sectoff and
put __size = ABSOLUTE (.); in the script.
--
Alan Modra
Australia Development Lab, IBM