_*frame_* functions in glibc

H . J . Lu hjl@lucon.org
Thu Jun 15 10:12:00 GMT 2000


On Thu, Jun 15, 2000 at 10:04:44AM -0700, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@lucon.org> writes:
> 
> > If those functions are referenced in the DSO in any way, they
> > will be exported from the main object. A reference can be as
> > simple as
> > 
> > static void *(foo) () = funtion;
> 
> You can prevent that.  DSOs (unline the main program) can have
> undefined references.
> 

>From gcc/crtstuff.c:

/* This is a kludge. The i386 GNU/Linux dynamic linker needs ___brk_addr,
   __environ and atexit (). We have to make sure they are in the .dynsym
   section. We accomplish it by making a dummy call here. This
   code is never reached.  */
 
#if defined(__linux__) && defined(__PIC__) && defined(__i386__)
  {
    extern void *___brk_addr;
    extern char **__environ;

    ___brk_addr = __environ;
    atexit (0);
  }
#endif

I put them in for libc 5 since it needs ___brk_addr and __environ
exported from the main object. I don't see why we cannot play the
same trick.


H.J.


More information about the Libc-hacker mailing list