This is the mail archive of the libc-hacker@cygnus.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]

__libc_subinit broken (PR 941) in glibc 2.1 ?



Hi,

Fritz send us a bug report where he claims that the __libc_subinit
hooks are not processed in glibc 2.0.111 (but they're processed in
2.0.7).

I've written a small test program that should check for proper
execution of __libc_subinit.  The test program should output 2 if
__libc_subinit works - otherwise 1.  With glibc 2.0.7 I get a 2 but
with 2.0.112 the erroneous result 1.

What's broken here?

Andreas


P.S. Here's the test program:

#include <stdio.h>
int dummy = 1;

static void
subinit(int argc, char *argv[], char *env[])
{
  dummy = 2;
}

/* from glibc include/libc-symbols.h */
/* Make SYMBOL, which is in the text segment, an element of SET.  */
#  define text_set_element(set, symbol) _elf_set_element(set, symbol)
#   define _elf_set_element(set, symbol) \
  static const void *const __elf_set_##set##_element_##symbol##__ \
    __attribute__ ((unused, section (#set))) = &(symbol)

text_set_element(__libc_subinit, subinit);


int
main (int argc, char **argv, char **env)
{
  printf ("dummy is %d\n", dummy);
}



-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


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