Once again replying to Alan's correct email id.

Please check for my reply at the end of mail.

Sorry for the inconvenience.

On Tue, Aug 01, 2006 at 12:23:22PM -0600, Eric W. Biederman wrote:
> Mohan Kumar M <[EMAIL PROTECTED]> writes:
> 
> > Hi Alan,
> >
> > As per kexec requirement, purgatory code is compiled with relocatable 
> > option and
> > during the runtime of kexec-tools, we apply the relocation to the purgatory 
> > code
> > based on the load address.
> >
> > But the relocatable object file contains some of STN_UNDEF entries in the
> > .rela.opd section. However .rela.text section does not have any STN_UNDEF
> > entries. We linked all the object files and hence there is no *undefined
> > symbols* in the final purgatory object file.
> >
> > Even though the .rela.opd section has undefined entries, we skipped applying
> > relocation for these entries and the code is working as expected.
> 
> Thanks that helps.
> 
> > But we need to fix this STN_UNDEF issue in the PPC64 code. Can you tell me 
> > how I
> > can resolve the STN_UNDEF entries in the .rela.opd section?
> 
> The practical question is what is the opd section?
> 
> Once we understand this we may be able to strip the .opd and
> .rela. sections or possibly ignore their relocations explicitly in
> the code.  But we need to track down what those sections are suppsed
> to be used for, to know if what we want to do is safe.
> 
> Eric
> 
Hi Eric,

One guy raised questions about opd section in ppcdev mailing list. I am just
copying the reply by Alan for that.

=================

From: Alan Modra <[EMAIL PROTECTED]>
To: Jonathan Bartlett <[EMAIL PROTECTED]>
Subject: Re: Why the "opd" section?
Cc: [EMAIL PROTECTED]

On Sun, Jul 23, 2006 at 09:01:38PM -0700, Jonathan Bartlett wrote:
> I'm learning PPC64 assembly language, and I found the existence of the
> "opd" sections containing function descriptors quite odd.  What is the use
> of these?  Are they used by the linker?  Why are they needed in the 64-bit
> ELF platforms and not the 32-bit ones?

OPD is an array of function pointers.  Function pointers on powerpc64
are not just simple pointers to some code;  They specify the code entry
point, the TOC pointer, and the static chain pointer (unused by C).
To call a function, you need to know all these values because functions
do not initialise their own TOC pointer.  This allows for more efficient
code.  The compiler/linker can omit the TOC pointer load when both
caller and callee are known to share the same TOC.  (In many ways, the
TOC is like the powerpc32 GOT.  powerpc32 -fpic/PIC code initialises the
GOT pointer on entry to every function, even when caller and callee are
known to have the same GOT pointer.)

===============
You can check the ppcdev mailing list for the entire thread.
http://ozlabs.org/pipermail/linuxppc-dev/2006-July/024644.html

Regards,
Mohan.




_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to