This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: interface prob in gas and ld
"Vineet Sharma, Noida" <vineets@noida.hcltech.com> writes:
> I have small query consider the following exambple
>
> ABC: ;Line 1
> .short 0x88 ; 2
> Lp.1: ; 3
> .short ABC+9 ; 4
>
> First of all what exactly does it mean, and how is it handled in general
> GAS/Linker?
For this gas should generate a reloc producing a 16 bit relocation
with a symbol of either the section symbol or ABC, and an offset of 9,
plus the section offset if any.
> Secondly:
> Now when my bfd assembler parses Line 4 it passes it to fix_new_exp().
What it passes to fix_new_exp() should just be an O_symbol, though, I
think.
> Poblem 1: fix_new_exp() does not handle negative value in fr_offset
> attribute
How does fr_offset figure into this? That is the offset into the
frag, which as far as I can see is irrelevant here.
> How can i pass this "value (exp->X_add_number)"(9 in this case) to
> linker along with the reloc entry.Though
> i have defined external_reloc in include/coff/XXX.h containing this
> value attribute.
Normally the 9 would be handled as a reloc addend. For some targets
an addend is stored in the reloc entry itself. For some it is stored
in the object file.
Ian