From 463e148b7581de66898a9675fc7dd5dfc88f8b0e Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 12 Jun 1996 04:00:32 +0000 Subject: Tue Jun 11 23:23:30 1996 Roland McGrath * Makerules (LDFLAGS-c.so): Use __libc_main instead of __libc_print_version as entry point for shared object. * version.c [HAVE_ELF] (__libc_main): New function. * elf/dl-load.c (_dl_map_object_from_fd): Relocate l_entry with the load address. --- version.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'version.c') diff --git a/version.c b/version.c index 3405ed5a68..e62504d2f9 100644 --- a/version.c +++ b/version.c @@ -36,6 +36,20 @@ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ PARTICULAR PURPOSE."); } + +#ifdef HAVE_ELF +/* This function is the entry point for the shared object. + Running the library as a program will get here. */ + +#include + +void +__libc_main (void) +{ + __libc_print_version (); + exit (0); +} +#endif /* Local Variables: -- cgit 1.4.1