mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Tue Jun 11 23:23:30 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* 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.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
Tue Jun 11 23:23:30 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Tue Jun 11 19:13:04 1996 Richard Henderson <rth@tamu.edu>
|
Tue Jun 11 19:13:04 1996 Richard Henderson <rth@tamu.edu>
|
||||||
|
|
||||||
* elf/dl-close.c: Include <string.h> for memcpy.
|
* elf/dl-close.c: Include <string.h> for memcpy.
|
||||||
|
@ -491,7 +491,7 @@ endef
|
|||||||
# since we define our own `.init' section specially.
|
# since we define our own `.init' section specially.
|
||||||
LDFLAGS-c.so = -nostdlib -nostartfiles
|
LDFLAGS-c.so = -nostdlib -nostartfiles
|
||||||
# Give libc.so an entry point and make it directly runnable itself.
|
# Give libc.so an entry point and make it directly runnable itself.
|
||||||
LDFLAGS-c.so += -e __libc_print_version
|
LDFLAGS-c.so += -e __libc_main
|
||||||
# Use our own special initializer and finalizer files for libc.so.
|
# Use our own special initializer and finalizer files for libc.so.
|
||||||
elfobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf))
|
elfobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf))
|
||||||
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
$(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||||
|
@ -357,6 +357,8 @@ _dl_map_object_from_fd (const char *name, int fd, char *realname,
|
|||||||
l->l_phdr = (void *) ((const ElfW(Ehdr) *) l->l_addr)->e_phoff;
|
l->l_phdr = (void *) ((const ElfW(Ehdr) *) l->l_addr)->e_phoff;
|
||||||
(ElfW(Addr)) l->l_phdr += l->l_addr;
|
(ElfW(Addr)) l->l_phdr += l->l_addr;
|
||||||
|
|
||||||
|
l->l_entry += l->l_addr;
|
||||||
|
|
||||||
elf_get_dynamic_info (l->l_ld, l->l_info);
|
elf_get_dynamic_info (l->l_ld, l->l_info);
|
||||||
if (l->l_info[DT_HASH])
|
if (l->l_info[DT_HASH])
|
||||||
_dl_setup_hash (l);
|
_dl_setup_hash (l);
|
||||||
|
14
version.c
14
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\
|
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
|
||||||
PARTICULAR PURPOSE.");
|
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 <stdlib.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
__libc_main (void)
|
||||||
|
{
|
||||||
|
__libc_print_version ();
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local Variables:
|
Local Variables:
|
||||||
|
Reference in New Issue
Block a user