bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to overwrite a symbolic link?


From: Marc Herbert
Subject: Re: How to overwrite a symbolic link?
Date: Fri, 07 May 2010 17:07:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

Le 07/05/2010 15:21, Peng Yu a écrit :

> Would you please elaborate a little more on how to use LD_PRELOAD to
> modify the call. If the library (for example, 'open' from stdlib.h)
> is statically compiled in the binary, is LD_PRELOAD going to replace
> it with a different 'open' function?

Header files usually do not hold definitions (only declarations), so
header files usually do not matter to LD_PRELOAD.

LD_PRELOAD plays games with dynamic libraries, it cannot modify static
linkage. But AFAIK 'open' is defined in the libc, so I would be quite
surprised that its definition ends up statically linked into your binary.



PS: you are not supposed to include stdlib.h to get the declaration of 'open'.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]