Skip to contentSkip to conversation

Assembler "Error: unsupported relocation against r0"

DISCUSSION Erik Christiansen 2 participants 2 messages Oct 31, 2002

lore
Share & tools
lore
#0 lore raw

powerpc-linux-as, built according to Penguinppc.org's "Cross
Development mini-howto for PPC Linux", is giving me stick about the simplest assembler statements:

fred.s >>>
.text
.align 2
li r0,0
addi r0,0,0
<<<

$ powerpc-linux-as fred.s
fred.s: Assembler messages:
fred.s:3: Error: unsupported relocation against r0
fred.s:4: Error: unsupported relocation against r0

The Motorola on-line doco seems to agree that this code is kosher.

Does anyone know of any description of what powerpc-linux-as will
swallow? (I have the generic (g)as document from gnu.org, and it is good for getting the directives right. Manpages, info, the archive, and the web have not added much substance.

Before going back to tackling the 1500 lines of board initialisation
code which assembled with Diab tools, I must discover what daft omissions of mine are causing this to fall over.

                          --------------------

powerpc-linux-as --version
GNU assembler 2.13.90.0.4 20020814
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty.
This assembler was configured for a target of `powerpc-linux'.

Regards,
Erik

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 12 lines · In message <[email protected]> you wrote:

powerpc-linux-as, built according to Penguinppc.org's "Cross
Development mini-howto for PPC Linux", is giving me stick about the simplest assembler statements:

fred.s >>>
.text
.align 2
li r0,0
addi r0,0,0
<<<

Quoted 4 lines
$ powerpc-linux-as fred.s
fred.s: Assembler messages:
fred.s:3: Error: unsupported relocation against r0
fred.s:4: Error: unsupported relocation against r0

Try this instead:

fred.s >>>

	.text
	.align 2
	li	0,0
	addi	0,0,0

<<<

or #include something like "ppc_asm.tmpl" (in the Linux kernel tree as arch/ppc/kernel/ppc_asm.tmpl)

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] I paid too much for it, but its worth it.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/