.rela.data

Ramana Radhakrishnan ramana.radhakrishnan@codito.com
Fri Apr 9 09:46:00 GMT 2004


Senthil Prakash wrote:
> Hi, 
> I am new to this group.
> I want to know when .rela.dat section will be created.

.rela.data would be created when you have a reference to a data 
member within the data section . I don't have a system currently 
to create a .rela.data but I am sure this would be the same else 
where .This is what is available on the i386 because the i386 
does not need RELA relocations .


The entry you see is actually a relocation entry that describes 
the behaviour given below.

int a;
int *b = &a;
void main(void)
{

}

[ramana@numenor tmp]$ readelf -r try1.o


Relocation section '.rel.data' at offset 0x3d0 contains 1 entries:
  Offset     Info    Type            Sym.Value  Sym. Name
00000000  00000901 R_386_32          00000004   a


For more basics, I would suggest that you read the excellent book 
by John Levine called Linkers and Loaders.

HTH
cheers

ramana


> Will be helpful if a test case is provided.
> Senthil.



More information about the Binutils mailing list