Shifting labels in constants

Alan Modra amodra@bigpond.net.au
Fri May 10 07:07:00 GMT 2002


On Fri, May 10, 2002 at 04:16:40PM +0300, Raul Hudea wrote:
> Thanks for your answer,
> 
> But even if I replace .text with .absolute in the small program that I
> wrote, I get the same error.

".section .absolute" just creates a new section which happens to be
called .absolute.  It's got nothing to do with absolute symbols,
which you create using .equ or `=', eg.

foo = 1234

> I am a little puzzled because if I have
>     .long (.L2 + 1) it works, but if I use
>     .long (.L2 >> 1) it does not work. 
> To me the two expressions look like arithmetic expressions, but one
> works and the other don't.

Symbol +/- constant can be respresented as a relocation in the object
file, symbol >> 1 can't.  It's as simple as that.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list