This is the mail archive of the binutils@sourceware.org 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: pic support question


Hello Ian,
Thanks for the response.
I guess, your right. The issue related to target specific implementation only.
I am able to calculate the offset from the GOT table to a symbol in data section. But its not enough. The GOT should be filled with all global symbols, which I am missing now.


Thanks for your comment.

Thanks
Swami

Ian Lance Taylor wrote:
"M R Swami Reddy" <MR.Swami.Reddy@nsc.com> writes:

Currently I am working supporting PIC feature for a 16-bit processor
in Binutils. I am able to generate the GOT based relocations and .got
and .got.plt
sections in the final linking stage. But problem is:

Unable to set/calculate the offset of GOT, for global symbols.

For ex: MOVD a@GOT, (r12)

In the above instruction, a-> is global var and linker should place the
offset value from Global offset Table. But its happening, Instead linker
just placing the 'a' address in the above instruction.

Can any one guess, what going wrong in the above

Sound like a problem in the implementation of whatever reloc you generate for a@GOT. That reloc needs to be implemented correctly in your backend. The generic code won't do it for you.

Ian



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