On Tue, Aug 01, 2006 at 12:23:22PM -0600, Eric W. Biederman wrote: > > 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. > 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
