This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: gas: undefined symbol in immediate operand
- From: "Jeremy Dexter" <jeremy dot dexter at datataker dot com dot au>
- To: <binutils at sourceware dot org>
- Date: Mon, 28 Aug 2006 11:43:31 +1000
- Subject: RE: gas: undefined symbol in immediate operand
Hi Nick
OK, I tried this on our PowerPC assembler and it works as you describe, ie.
a relocation entry is generated.
So basically it looks like the "Error: undefined symbol moo used as an
immediate value" message was added to the ARM assembler sometime after 2.14.
It's not really practical for me to upgrade to the latest ARM tools so I'll
just live with it for now.
Thanks again for your assistance!
cheers
Jeremy
-----Original Message-----
From: Nick Clifton
Sent: Friday, 25 August 2006 5:44 pm
To: Jeremy Dexter
Cc: binutils@sourceware.org
Subject: Re: gas: undefined symbol in immediate operand
Hi Jeremy,
> I'm using a pre-built ARM toolchain (supplied with an embedded development
> system) running on Windows under cygwin.
I think that you must have an old version of the ARM assembler. The
current versions definitely do report an error for the use of an
undefined symbol as an immediate operand.
> We've also tried this on a more recent PowerPC toolchain, this time
running
> on Linux and get a similar result:
> The objdump output shows that the assembler hasn't created a relocation
> entry for the undefined "moo" symbol,
What objdump output ? When I tried running objdump I saw this:
$ objdump -Dr test.o
test.o: file format elf32-powerpc
Disassembly of section .text:
00000000 <_start>:
0: 3f e0 00 00 lis r31,0
2: R_PPC_ADDR16_HI moo
4: 3f e0 ff 00 lis r31,-256
8: 4e 80 00 20 blr
Which clearly does show the reloc against symbol "moo". Furthermore,
when I tried to link this object file, I received an error message:
$ ld test.o
test.o: In function `_start':
(.text+0x2): undefined reference to `moo'
This is which an assembler and linker compiled from today's binutils
sources.
Cheers
Nick