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 16/05/2019 16:05, Alan Modra wrote:
On Thu, May 16, 2019 at 11:29:48AM +0200, Sebastian Huber wrote:
On 15/05/2019 06:09, Alan Modra wrote:
The source you show is slightly crazy too. Why use @sectoff when
expecting a SHN_ABS symbol?
It seems the bootloader must be relocatable. What would be the proper way to
work with absolute addresses? Store them in global variables which contain a
abs@fixup relocation?
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
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.