LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   about -shared option in gcc (https://www.linuxquestions.org/questions/programming-9/about-shared-option-in-gcc-442407/)

George2 05-07-2006 03:43 AM

about -shared option in gcc
 
lo everyone,


I have used -shared options for a long time. Today
when I dig into the detailed description of shared
option of gcc, I found something strange to me.

Quote from gcc man page,

--------------------
-shared
Produce a shared object which can then be linked with
other objects to form an executable. Not all systems
support this option. For predictable results, you must
also specify the same set of options that were used to
generate code (-fpic, -fPIC, or model suboptions) when
you specify this option.[1]

1.
On some systems, gcc -shared needs to build
supplementary stub code for constructors to work. On
multi-libbed systems, gcc -shared must select the
correct support libraries to link against. Failing to
supply the correct flags may lead to subtle defects.
Supplying them in cases where they are not necessary
is innocuous.
--------------------

I only understand this statement "Produce a shared
object which can then be linked with other objects to
form an executable." and I do not know what are the
other points mean.

Could anyone help to introduce what do they mean and
will the points impact my current work/previous
comprehension of shared option of gcc?


regards,
George


All times are GMT -5. The time now is 10:02 AM.