This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: Is it valid in GAS?
- From: "Vineet Sharma, Noida" <vineets at noida dot hcltech dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>, "Vineet Sharma, Noida" <vineets at noida dot hcltech dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 8 Dec 2003 12:36:56 +0530
- Subject: RE: Is it valid in GAS?
Hi,
But how do i pass this "value ( -5 in this case)" to linker, if i write
it to output file it is overwritten by assembler itself when it call reloc
routines.
Lp.1:
> .short ___DTOR_LIST - 5
And reloc_entry never has this value of -5 in it when linker call
coff_XXX_reloc()
Thanks in adavnce
Vineet
-----Original Message-----
From: Alan Modra [mailto:amodra@bigpond.net.au]
Sent: Saturday, December 06, 2003 7:14 AM
To: Vineet Sharma, Noida
Cc: binutils@sources.redhat.com
Subject: Re: Is it valid in GAS?
On Fri, Dec 05, 2003 at 04:05:29PM +0530, Vineet Sharma, Noida wrote:
> Hi,
> Is the following declartion valid in GAS Assembler.
>
> ___DTOR_LIST:
> .short 0x88
> Lp.1:
> .short ___DTOR_LIST - 5 /*Is negative i .e
substraction
> allowed*/
>
>
> If yes, then how do i find this addended in tc_gen_reloc().
Yes, it is valid. Please see how other targets do this. For example,
powerpc-linux-gas produces
Relocation section '.rela.text' at offset 0x200 contains 1 entries:
Offset Info Type Sym.Value Sym. Name + Addend
00000002 00000403 R_PPC_ADDR16 00000000 ___DTOR_LIST + fffffffb
--
Alan Modra
IBM OzLabs - Linux Technology Centre