This is the mail archive of the binutils@sources.redhat.com 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: Shifting labels in constants


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


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