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]

Re: Please help with __attribute__ weak


On Tue, Jul 26, 2005 at 07:19:43AM -0400, Dimitry Golubovsky wrote:
> 
> I need to declare a symbol which is weaker in the executable than in any
> external static or dynamic library.
> 
> In other words, the executable provides some fallback function
> implementation (in my example, for "write"). But if the linker or
> dynamic linker resolves it, the symbol definition from an external
> library must be used.
> 

The weak symbol is different from the normal one only during creating
executable or shared library if it is in a relocatable file. You
can't use weak symbol for your purpose. But you can mark your symbol in
shared library protected.



H.J.


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