Functions are not loaded?!!

Ian Lance Taylor iant@google.com
Sun May 1 03:38:00 GMT 2011


ali hagigat <hagigatali@gmail.com> writes:

> Now I have a new question, so when we want to use a library we must
> put it in the rightmost place of a command line to make sure that all
> the necessary functions are written in the final image by the linker,
> is that right?

On the command line, you must put the library lib.a to the right of all
object files and libraries which use symbols defined by lib.a, and to
the left of all libraries which provide symbols used by lib.a.

This approach can be modified by linker options --whole-archive and
--start-group, q.v.

Ian



More information about the Gcc-help mailing list