This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

RE: weak symbols and pe-i386 format


Erik Leunissen
Sent: Monday, 25 June 2007 9:38 a.m.

> 
> Does the pe-i386 object format support weak symbol definitions?
No.
> Does the pe-i386 object format support weak symbol references?
PE-COFF spec supports "weak externs".  See "Section 5.5.3. Auxiliary
Format 3: Weak Externals"
in the Microsoft Portable Executable and Object File Format
Specification
Google for pecoff_v8.  The v6 spec was/is avaliable .pdf, but I have
only seen the newer spec as MS Word doc. 

A characteristic flag indicates the type of refernence. 

IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY indicates that no library search for
sym1 should be performed.
IMAGE_WEAK_EXTERN_SEARCH_LIBRARY indicates that a library search for
sym1 should be performed.
IMAGE_WEAK_EXTERN_SEARCH_ALIAS indicates that sym1 is an alias for sym2.

Currently ld supports IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY.   

weak aliases also seem to work (with GNU ld) even though the
IMAGE_WEAK_EXTERN_SEARCH_ALIAS characteristic is not set.

I imagine the  MS linker would have trouble with GNU weak aliases
without the flag.

 
> Thanks for any insight,
> 
> Erik Leunissen
> ==============
> 


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