This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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!



-----Original Message-----
From: Nick Clifton
Sent: Friday, 25 August 2006 5:44 pm
To: Jeremy Dexter
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
> 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 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]