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: extracting relocation info from COFF from "section contents" base d on partial_inplace


> -----Original Message-----
> From: binutils-owner On Behalf Of Liang, James
> Sent: 08 April 2004 19:05

> The output of objdump -s and bfd_get_section_contents is just 
> a array of
> bytes.  What I'd like to know is where the Addend and other 
> offset related
> info is stored.

  The addends are *in* that array of bytes, at the offset indicated by the
arelent->address field (what I referred to as 'destination' in my last
post).


> For example, if my code says:
> 	extern struct someStruct externData;
> 
> 	void function() {
> 	  printf("%d\n",externData.accessCounter);
> 	}
> 
> 
> There should normally be some info stored in the object, I 
> think the Addend
> field, that tells the offset to accessCounter.

Yep.  The symbol will point to externData and the offset/addend will be the
distance to the accessCounter member.

However, the whole point (about REL vs RELA) is that in this case, the
addend is not in a field in the arelent reloc struct, but is in the bytes of
the input section indicated by the address.


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....


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