OSDN Git Service

Fixup build a bit. Be sneaky and include everything into
authorEric Andersen <andersen@codepoet.org>
Wed, 23 Jan 2002 16:04:40 +0000 (16:04 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 23 Jan 2002 16:04:40 +0000 (16:04 -0000)
a single .c file, making stuff be even smaller.

ldso/ldso/.cvsignore
ldso/ldso/Makefile
ldso/ldso/dl-elf.c
ldso/ldso/dl-hash.c
ldso/ldso/hash.c
ldso/ldso/i386/elfinterp.c
ldso/ldso/ldso.c
ldso/ldso/readelflib1.c

index 962b653..ed93c7d 100644 (file)
@@ -1,2 +1,2 @@
 ld-uclibc.so*
-ld-uClibc.h
+ldso.h
index 8a320c4..37e114b 100644 (file)
@@ -29,34 +29,44 @@ include $(TOPDIR)Rules.mak
 
 LDSO_FULLNAME=ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).so
 
-CFLAGS += -fPIC -D__PIC__
 #XXFLAGS += #-DDL_DEBUG #-funroll-loops
 XXFLAGS+=-DUCLIBC_TARGET_PREFIX=\"$(TARGET_PREFIX)\" \
        -DUCLIBC_DEVEL_PREFIX=\"$(DEVEL_PREFIX)\" \
        -DUCLIBC_BUILD_DIR=\"$(shell cd $(TOPDIR) && pwd)\"
-CSRC= ldso.c hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c
+LDFLAGS=-nostdlib -shared --warn-common --export-dynamic --warn-once \
+       -z combreloc --sort-common --discard-locals --discard-all
+CSRC= ldso.c #hash.c readelflib1.c $(TARGET_ARCH)/elfinterp.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 ASRC=$(shell ls $(TARGET_ARCH)/*.S)
 AOBJS=$(patsubst %.S,%.o, $(ASRC))
 OBJS=$(AOBJS) $(COBJS)
 
+ifneq ($(strip $(DODEBUG)),true)
+LDFLAGS+=-s
+endif
 
 all: lib
 
 lib:: ldso.h $(OBJS) $(DLINK_OBJS)
-       $(LD) -e _dl_boot $(LDFLAGS) -nostdlib -shared -o $(LDSO_FULLNAME) \
-           -soname=$(UCLIBC_LDSO) -Bstatic $(OBJS)
+       $(CC) -e _dl_boot $(LDFLAGS) -o $(LDSO_FULLNAME) \
+           -Wl,-soname=$(UCLIBC_LDSO) $(OBJS)
        install -d $(TOPDIR)lib 
        install -m 755 $(LDSO_FULLNAME) $(TOPDIR)lib
        (cd $(TOPDIR)lib && ln -sf $(LDSO_FULLNAME) $(UCLIBC_LDSO))
 
 ldso.h: Makefile
-       echo "#define _dl_static_progname \""$(UCLIBC_LDSO)"\"" > ld-uClibc.h
+       echo "const char *_dl_progname=\""$(UCLIBC_LDSO)"\";" > ldso.h
+       echo "#include \"$(TARGET_ARCH)/elfinterp.c\"" >> ldso.h
+
 
 $(COBJS): %.o : %.c
        $(CC) $(CFLAGS) $(XXFLAGS) -I. -I./$(TARGET_ARCH) -I../libdl -c $< -o $@
        $(STRIPTOOL) -x -R .note -R .comment $*.o
 
+$(AOBJS): %.o : %.S
+       $(CC) $(CFLAGS) -I. -I./$(TARGET_ARCH) -I../libdl -c $< -o $@
+       $(STRIPTOOL) -x -R .note -R .comment $*.o
+
 clean::
        $(RM) -f $(UCLIBC_LDSO)* $(OBJS) $(LDSO_FULLNAME)* core *.o *.a *.s *.i ldso.h *~
 
index 335f6fc..d12f9e1 100644 (file)
 /* This file contains the helper routines to load an ELF sharable
    library into memory and add the symbol table info to the chain. */
 
-#include "linuxelf.h"
-#include "ld_hash.h"
-#include "ld_syscall.h"
-#include "ld_string.h"
-#include <sys/mman.h>
-#ifdef USE_CACHE
-#include "../config.h"
-#endif
-
-extern char *_dl_progname;
-
 #ifdef USE_CACHE
 
 static caddr_t _dl_cache_addr = NULL;
index 40d29bb..15dfc3a 100644 (file)
 
 /* Various symbol table handling functions, including symbol lookup */
 
-#include "dlfcn.h"
-#include "linuxelf.h"
-#include "ld_hash.h"
-#include "ld_syscall.h"
-#include "ld_string.h"
-
 /*
  * This is the start of the linked list that describes all of the files present
  * in the system with pointers to all of the symbol, string, and hash tables, 
index 40d29bb..15dfc3a 100644 (file)
 
 /* Various symbol table handling functions, including symbol lookup */
 
-#include "dlfcn.h"
-#include "linuxelf.h"
-#include "ld_hash.h"
-#include "ld_syscall.h"
-#include "ld_string.h"
-
 /*
  * This is the start of the linked list that describes all of the files present
  * in the system with pointers to all of the symbol, string, and hash tables, 
index 7745b14..3b8b58a 100644 (file)
@@ -39,13 +39,6 @@ static char *_dl_reltypes[] =
    a more than adequate job of explaining everything required to get this
    working. */
 
-#include "linuxelf.h"
-#include "ld_hash.h"
-#include "ld_syscall.h"
-#include "ld_string.h"
-
-extern char *_dl_progname;
-
 extern int _dl_linux_resolve(void);
 
 unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry)
index 6d8b881..61db05d 100644 (file)
  * can transfer control to the user's application.
  */
 
-#include "linuxelf.h"
 #include <stdarg.h>
+#include "linuxelf.h"
 #include "ld_hash.h"
 #include "ld_syscall.h"
 #include "ld_string.h"
+#include "dlfcn.h"
 #include "../config.h"
 
 #define ALLOW_ZERO_PLTGOT
 static char *_dl_malloc_addr, *_dl_mmap_zero;
 char *_dl_library_path = 0;            /* Where we look for libraries */
 char *_dl_preload = 0;                 /* Things to be loaded before the libs. */
-#include "ld-uClibc.h"                 /* Pull in the name of ld.so */
-const char *_dl_progname=_dl_static_progname;
 static char *_dl_not_lazy = 0;
 #ifdef DL_TRACE
 static char *_dl_trace_loaded_objects = 0;
@@ -134,6 +133,7 @@ void _dl_debug_state(void);
 char *_dl_get_last_path_component(char *path);
 
 #include "boot1_arch.h"
+#include "ldso.h"                      /* Pull in the name of ld.so */
 
 
 /* When we enter this piece of code, the program stack looks like this:
@@ -1210,3 +1210,5 @@ void _dl_dprintf(int fd, const char *fmt, ...)
     return;
 }
 
+#include "hash.c"
+#include "readelflib1.c"
index 335f6fc..d12f9e1 100644 (file)
 /* This file contains the helper routines to load an ELF sharable
    library into memory and add the symbol table info to the chain. */
 
-#include "linuxelf.h"
-#include "ld_hash.h"
-#include "ld_syscall.h"
-#include "ld_string.h"
-#include <sys/mman.h>
-#ifdef USE_CACHE
-#include "../config.h"
-#endif
-
-extern char *_dl_progname;
-
 #ifdef USE_CACHE
 
 static caddr_t _dl_cache_addr = NULL;