This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How does ld link against library archives?


L.S.

Regarding the "-l" command line option for the GNU linker, the manual page says:

"If the archive defines a symbol which was undefined in some object which appeared before the archive on the command line, the linker will include the appropriate file(s) from the archive."

I was wondering what "include the appropriate file(s)" exactly means in this context. Specifically, I would like to know which code from the archive is being *added* to the output file [*].

- code for all symbols in the archive;
- code for those object members in the archive which hold symbols that are still unresolved;
- code for only those specific symbols that are still unresolved;
- ... something else ?


I'd appreciate very much if somebody clarified this.

Thanks in advance,

Erik Leunissen
==============


[*]
I emphasized "added" because imported code may be more than what is exactly needed for symbol resolution.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]