[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: gp-relative relocation against dynamic symbol SwGlobalDocShell::pObjectFactory

On Saturday 16 August 2003 03:36 pm, Uncle George wrote:
> I'm reasonably sure that you might need PIC code to create a
> dynamic library, from static &
> other dynamic libraries, I'm not so sure thats true if you
> want an executable, derived from static & dynamic libraries.

Let me assure you, you need PIC code in either case. ;)  -fpic or 
-fPIC instructs GCC to modify the code's register usage at an 
assembly-language level before the assembly code gets passed to 
gas.  So it needs to be done before the object file is 
generated, and every object file that gets linked into a dynamic 
library needs to have it done (at least on Alpha).

My rule of thumb is, whenever you build a static library with no 
corresponding dynamic library, the static library should be 
built with -fPIC.  Otherwise you're liable to have this very 
problem further down the road and end up having to retrace your 

"If a server crashes in a server farm and no one pings it, does 
it still cost four figures to fix?"

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []