another global LD_PRELOAD patch for rtld-elf

2001-12-01 Thread Lamont Granquist
oad_preload_objects(char *); static Obj_Entry *load_object(char *); static void lock_check(void); static Obj_Entry *obj_from_addr(const void *); @@ -359,7 +361,9 @@ sym_zero.st_shndx = SHN_ABS; dbg("loading LD_PRELOAD libraries"); -if (load_preload_objects()

Re: LD_PRELOAD odities / Documentation?

2000-08-04 Thread John Polstra
In article <[EMAIL PROTECTED]>, Karl Pielorz <[EMAIL PROTECTED]> wrote: > One of the ways I've tried implementing syscalls is to dlopen() the > correct library, and fetch the routines address from there (using > dlsym) - and calling the routine that way... > > This doesn't seem to help though :(

Re: LD_PRELOAD odities / Documentation?

2000-08-04 Thread Karl Pielorz
Bjoern Fischer wrote: > To wrap libc functions you have to use dlsym() with the special > handle RTLD_NEXT to get the next incarnation of your function. > E.g. you want to wrap fchmod(), so write your own fchmod() and > after you `corrected' the params you may have to call the `real' > fchmod().

Re: LD_PRELOAD odities / Documentation?

2000-08-04 Thread Mikko Tyolajarvi
ore an >executable... I've gotten everything to compile, and the LD_PRELOAD works, but >a lot of syscall's from the wrapper library fail either with bizare messages >such as "malloc(): recursive call", or just die horibly (segmentation faults, >and all sorts). [...]

Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Tony Finch
Karl Pielorz <[EMAIL PROTECTED]> wrote: > >One of the ways I've tried implementing syscalls is to dlopen() the correct >library, and fetch the routines address from there (using dlsym) - and calling >the routine that way... > >This doesn't seem to help though :( I've made this work across Solaris

Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Bjoern Fischer
On Thu, Aug 03, 2000 at 11:25:27AM +0100, Karl Pielorz wrote: > The code is a 'wrapper' / 'shim' that's meant to be LD_PRELOAD'ed before an > executable... I've gotten everything to compile, and the LD_PRELOAD works, but > a lot of syscall's

Re: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Karl Pielorz
Daniel O'Connor wrote: > > On 03-Aug-00 Karl Pielorz wrote: > > Any pointers would be greatefuly received, unfortunately this all works > > under > > Linux (I'm not bashing anyone on the head with that, I'm far more interested > > in getting it working under FreeBSD)... > > I think the pro

RE: LD_PRELOAD odities / Documentation?

2000-08-03 Thread Daniel O'Connor
On 03-Aug-00 Karl Pielorz wrote: > Any pointers would be greatefuly received, unfortunately this all works > under > Linux (I'm not bashing anyone on the head with that, I'm far more interested > in getting it working under FreeBSD)... I think the problem is that your calls are being resolve

LD_PRELOAD odities / Documentation?

2000-08-03 Thread Karl Pielorz
Hi All, I'm working on some code that runs fine on Linux, but not under FreeBSD... Trying to port the code is proving to be a pain... The code is a 'wrapper' / 'shim' that's meant to be LD_PRELOAD'ed before an executable... I've gotten everything to comp

Re: LD_PRELOAD

2000-01-22 Thread Tony Finch
x. (This implies that the Solaris rtld documentation isn't quite complete regarding its support for C++ mechanisms.) static void startup(void) __attribute__ ((constructor)); >>> You're probably the first person on earth to >>> have more than one library in LD_PRELOAD. :-)

Re: LD_PRELOAD

2000-01-22 Thread John Polstra
C++ and use a global constructor. > > No. Never. No way. NO. :-) I didn't mean write everything in C++ -- just the initialization hook. It's not that bad. There's an example in "src/lib/libc_r/uthread/uthread_autoinit.cc". The advantage of using C++ for this is

Re: LD_PRELOAD

2000-01-21 Thread Tony Finch
John Polstra <[EMAIL PROTECTED]> wrote: >Tony Finch <[EMAIL PROTECTED]> wrote: >> >> I'm experimenting with using LD_PRELOAD to implement "shim" >> wrappers around functions in libc. The first problem I had was >> compiling my shim library so

Re: LD_PRELOAD

2000-01-21 Thread John Polstra
In article <[EMAIL PROTECTED]>, Tony Finch <[EMAIL PROTECTED]> wrote: > I'm experimenting with using LD_PRELOAD to implement "shim" wrappers > around functions in libc. It's really easy to do on Solaris but I'm > having some difficulty on FreeBSD.

Re: LD_PRELOAD

2000-01-21 Thread Tony Finch
Tony Finch <[EMAIL PROTECTED]> wrote: > > This brings me on to the second problem. I want to do some > initialization of my library before the real action starts. On Solaris > the linker calls a function in the object called _init() when it is > loaded; it's easy to make this work. I can see simi

LD_PRELOAD

2000-01-21 Thread Tony Finch
I'm experimenting with using LD_PRELOAD to implement "shim" wrappers around functions in libc. It's really easy to do on Solaris but I'm having some difficulty on FreeBSD. The first problem I had was compiling my shim library so that the rtld would accept it. On Solar