Movatterモバイル変換
[0]ホーム
This is the mail archive of thebinutils@sources.redhat.commailing list for thebinutils project.
C_WEAKEXT Weak Externals in i386-pe COFF
- From: AWLaFramboise at aol dot com
- To: binutils at sources dot redhat dot com
- Date: Tue, 24 Jun 2003 21:29:33 -0400
- Subject: C_WEAKEXT Weak Externals in i386-pe COFF
Hi,I'm trying to get GNU ld to link objects produced fromMSVC, and I beleive I have found a problem with binutils'C_WEAKEXT support:Weak externals, apparently known within binutils asC_WEAKEXT, to Win32 as IMAGE_SYM_CLASS_WEAK_EXTERNAL,and documented in the Win32 PE COFF spec in section 5.5.3,are a loose analog of ELF weak symbols. Binutils seemsto treat them the same way as their ELF counterparts, however,they are actually substancially different.Quoting from the spec:"If a definition of sym1 is linked, then an external reference to the symbol is resolved normally. If a definition of sym1 is not linked, then all references to the weak external for sym1 refer to sym2 instead. The external symbol, sym2, must always be linked; typically it is defined in the module containing the weak reference to sym1."In other words, where ELF weak symbols default to zero ifnot resolved, COFF weak symbols default to some othersymbol.Is there some way to get binutils to correctly resolvethese kinds of symbols? Has anyone worked on this, orhad any luck getting these kinds of things to link?If no to the above, how difficult would it be to add thissupport? (I am unfamiliar with binutils internals.)(I'm trying to avoid using the MS linker, in part becauseit doesn't seem to support GCC as well as GNU ld does.)Any help or pointers would be appreciated,Aaron
[8]ページ先頭