This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
glibc 2.1 is ok and a patch
- To: drepper@cygnus.com (Ulrich Drepper)
- Subject: glibc 2.1 is ok and a patch
- From: hjl@lucon.org (H.J. Lu)
- Date: Fri, 11 Sep 1998 16:21:49 -0700 (PDT)
- Cc: libc-hacker@cygnus.com (GNU C Library)
glibc 2.1 in cvs as of 980910 23:00pm is ok except for the resolver
bug.
Here is a patch to optimize the static binary since we don't need
to check dynamically linked libraries in a static binary.
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
Thu Apr 30 18:20:38 1998 H.J. Lu <hjl@gnu.org>
* elf/dl-load.c (_dl_init_paths): Don't check the dynamic
loader if PIC is not defined.
* sysdeps/unix/sysv/linux/init-first.h (SYSDEP_CALL_INIT):
Don't check if PIC is not defined.
Index: elf/dl-load.c
===================================================================
RCS file: /home/work/cvs/gnu/glibc/elf/dl-load.c,v
retrieving revision 1.1.1.29
diff -u -p -r1.1.1.29 dl-load.c
--- dl-load.c 1998/09/11 13:48:36 1.1.1.29
+++ dl-load.c 1998/09/11 13:56:37
@@ -458,11 +458,13 @@ _dl_init_paths (const char *llp)
struct r_search_path_elem *pelem, **aelem;
size_t round_size;
+#ifdef PIC
/* We have in `search_path' the information about the RPATH of the
dynamic loader. Now fill in the information about the applications
RPATH and the directories addressed by the LD_LIBRARY_PATH environment
variable. */
struct link_map *l;
+#endif
/* Number of elements in the library path. */
size_t nllp;
@@ -526,6 +528,7 @@ _dl_init_paths (const char *llp)
}
*aelem = NULL;
+#ifdef PIC
l = _dl_loaded;
if (l != NULL)
{
@@ -583,6 +586,7 @@ _dl_init_paths (const char *llp)
}
}
else
+#endif
{
/* This is a statically linked program but we still have to
take care for the LD_LIBRARY_PATH environment variable. We
Index: sysdeps/unix/sysv/linux/init-first.h
===================================================================
RCS file: /home/work/cvs/gnu/glibc/sysdeps/unix/sysv/linux/init-first.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 init-first.h
--- init-first.h 1997/03/17 01:49:01 1.1.1.2
+++ init-first.h 1998/09/11 23:11:14
@@ -21,6 +21,7 @@
This is done in one of two ways: either in the stack context
of program start, or having dlopen pass them in. */
+#ifdef PIC
#define SYSDEP_CALL_INIT(NAME, INIT) \
void NAME (void *arg) \
{ \
@@ -48,3 +49,16 @@ void NAME (void *arg) \
\
INIT (argc, argv, envp); \
}
+#else
+#define SYSDEP_CALL_INIT(NAME, INIT) \
+void NAME (void *arg) \
+{ \
+ int argc; \
+ char **argv, **envp; \
+ argc = (int) arg; \
+ argv = (char **) &arg + 1; \
+ envp = &argv[argc+1]; \
+ \
+ INIT (argc, argv, envp); \
+}
+#endif