From: Michael G. <mg...@te...> - 2005-02-17 09:35:29
|
[link libs after objects] > Is there a reason for this order? I used gcc on linux for quite a few tim= es=20 > and (AFAIR) I specified libs like I in my first post. I haven't checked but from my own experience and from the ld info page I doubt that. Here is an excerpt from ld's info page: =2D( archives -) =2D-start-group archives --end-group The archives should be a list of archive files. They may be eithe explicit file names, or -l options. The specified archives are searched repeatedly until no new undefined references are created. Normally, an archive is searched only once in the order that it is specified on the command line. If a symbol in that archive is needed to resolve an undefined symbol referred to by an object in an archive that appears later on the command line, the linker would not be able to resolve that reference. By grouping the archives, they all be searched repeatedly until all possible references are resolved. Using this option has a significant performance cost. It is best to use it only when there are unavoidable circular references between two or more archives. So to answer your question: There is a reason: It is because it can have a serious impact on the performance for large links. Best, Michael =2D-=20 Vote against SPAM - see http://www.politik-digital.de/spam/ Michael Gerdau email: mg...@te... GPG-keys available on request or at public keyserver |