This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gas: undefined symbol in immediate operand
- From: Nick Clifton <nickc at redhat dot com>
- To: Jeremy Dexter <jeremy dot dexter at datataker dot com dot au>
- Cc: binutils at sourceware dot org
- Date: Fri, 25 Aug 2006 08:44:24 +0100
- Subject: Re: gas: undefined symbol in immediate operand
- References: <002f01c6c7e6$c1535fb0$3c01a8c0@ad.datataker.com.au>
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