On 24 Apr 2000, Oleg Goldshmidt wrote:
> Date: 24 Apr 2000 18:18:59 +0300
> To: [EMAIL PROTECTED]
> From: Oleg Goldshmidt <[EMAIL PROTECTED]>
> Subject: Re: Linking Q. - merging global symbols.
>
> Omer Mussaev <[EMAIL PROTECTED]> writes:
>
> > gcc ./foo.c -Xlinker --wrap -Xlinker printf foo.c wraps.c ; ./a.out
> ^^^^^^^ ^^^^^
>
> I suppose you need foo.c only once.
you are right, it is not wierd magic, it is my error.
>
> I am not sure I understand completely how that will help in this
> situation. Suppose there is global symbol foo in both the program and
> the shared library. Won't any reference to foo be resolved as
> __wrap_foo in _both_ the program and the library? To prevent conflict,
> either the program or the library must be modified to refer to
> __real_foo. If that is the case, then isn't it simpler to modify the
> globals' names in the code?
IMNSHO, it is simpler, and smarter, and ....
However, shit happens.
>
> Maybe I am just dense... I'd like to learn the trick, if it works.
>
> Another point that may or may not be relevant: -Xlinker is
> gcc-specific.
It is very important point, and it is true.
omerm
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]