c - Linking a shared library against a static library: must the static library be compiled differently than if an application were linking it? -


At least on Linux and Solaris, the static library is actually a bunch of compile. O is thrown into a large file.

When a static library is compiled, then generally the fiber flag is omitted, hence the generated code state is dependent.

Now say that my static library is B. I have made it and as a result, there is a file which is really dependent on all the situations .O files. Now I have a shared library that I want to make, A, and I want to statically link it. When I create A, naturally I will use the -fpic flag to make mass-code status independent. But if I link against B, then I am not dependent on the situation and am making the status of independent object files?

I am getting lots of text transfer errors, unless I also specify the -amamir-text, and I think the reason probably seems to be that when I compile a library, I It should be 3 time, a shared version, a stable version and a stable-compiled, which needs to be compiled. Am i right I can only use the -mimurecture-text, but the G + man page says that if you do this then the object is not actually shared (it is not clear whether all this is unreadable or just statically link Are the parts run, do anyone know?). You do not need to use PIC code in shared items (as you have discovered that you can use it - -

He said, non-PIC codes in shared commodities are more heavyweight. Along with the PIC code, the text pages on the text page disc have direct memory mapping of the pages. This means that if multiple processes are using a shared object, they can share the memory page.

But if you do not have a PIC code, if the runtime linker loads the shared object, then it will have to apply a fix. This means that on text pages it means that any of the processes that use shared processes The text will be the page, which has a fix over it (even though the stock object is copied to the same address, only the notice is the same as the page is modified and not modified in the same way).

For me, the important issue is whether you will run many processes simultaneously, which load each shared object. If you do this, then surely it is certain to ensure that all The code is PIC in SO.

But if this is not the case and the shared object is weighted in only one process, then it is not nearly important


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -