This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
LD: function-level linking
- From: "Tzu-Chien Chiu" <tzuchien dot chiu at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 10 Jul 2006 14:50:33 +0800
- Subject: LD: function-level linking
Hello all.
I'm looking for a similar feature available in Visual C++.
Function-level linking.
In Visual C++, there is an option "/Gy" which enables "function-level
linking". That is, each function is packaged separately as a COMDAT,
and later the linker option "/OPT:REF" eliminates the COMDATs which
are never referenced.
FYI: http://msdn2.microsoft.com/en-us/library/bxwfs976.aspx
In this way, the entire object file won't have to be linked as a whole
when only one of the functions in it is referenced. It's preferred
linking for embedded system software. Not all libraries are design ed
as glibc, which has a separate file for each file, and it's sometimes
not easy or feasible to modify the source code of the libraries.
I can not find similar compiler and linker options in the GNU tool
chain. What I missed?
--
Tzu-Chien Chiu - SMedia Technology Corp.
URL: http://www.csie.nctu.edu.tw/~jwchiu/