This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: Problem with library preloading plus procps


On Fri, Dec 28, 2001 at 04:01:35PM +0000, Manuel Arriaga wrote:
> Hello,
> 
> I am using binutils-2.11.90.0.19, and procps-2.0.7 on GNU/Linux. 
> 
> When I set LD_PRELOAD and run a program, I expect _init() (defined in the 
> preloaded object) to be called before any code in the program is executed.
> 
> However, if you compile the code in the attached tarball, preload it and then 
> run one of the commands in the procps package (ps, top, free) you might 
> notice that the open() function is called before _init() is run. 
> 
> Can you offer any hints as to why this might be happening? As far as I know, 
> this has occurred under Slackware 7.1, Slackware 8.0 and RedHat 7.1.
> 
> Best regards,
> 
> Manuel Arriaga
> 
> PS: This isn't happening only on my machine; several users of libtrash 
> (http://www.m-arriaga.net/software/libtrash) have described the same problem.


It is not a binutils issue. It is controlled by glibc. If you do,

# LD_DEBUG=files free

you will see the order of init being called. I don't know what the
right order is for calling init when LD_PRELOAD is used. Does anyone
know?



H.J.


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