This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
is there any way to change the order of name resolution in linking (aside from putting the libraries in the right order?)
- From: Dan Hitt <dan dot hitt at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 26 Sep 2012 22:09:12 -0700
- Subject: is there any way to change the order of name resolution in linking (aside from putting the libraries in the right order?)
I am building some code and i need a certain library to be linked in
last, so it can resolve symbols left unresolved earlier.
Normally the way to do this would be to just list that library last
on the command line.
However, i'm using a build system which constructs all the
commands for me, and although it makes a provision for
adding extra arguments to the linker, they end up going first.
So although i can add arguments to the link, i cannot order
them the way i want, and i get unresolved symbols as a consequence.
So i'm wondering if there's any argument i can slip in that will change
the order that gcc runs through the libraries in.
(The gcc info suggest not, but perhaps there's an undocumented
option for doing this?)
Thanks in advance for any clues on this.
dan