Browse Source

#include "dl-startup.c into ldso.c, making ldso one compilation unit.
Now all functions and vaiables can be made static to reduce relocs.
Basicly, all variables should be merged into one struct variable
and then export that struct. Exported functions should be exported
as functions pointers in the above struct. This will reduce the
number of relocs inside ldso to a handful.

Add -Bsymbolic to linker for ldso. This will resolve all functions
(all JMP_SLOT goes away) and the remaining relocs are transformed into
RELATIVE relocs.

Joakim Tjernlund 19 years ago
parent
commit
d6ea385286
2 changed files with 3 additions and 2 deletions
  1. 2 2
      ldso/ldso/Makefile
  2. 1 0
      ldso/ldso/ldso.c

+ 2 - 2
ldso/ldso/Makefile

@@ -40,10 +40,10 @@ XXFLAGS+= $(XARCH_CFLAGS) $(CPU_CFLAGS) $(PICFLAG) \
 XXFLAGS :=$(XXFLAGS:-O0=-O1)
 
 XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
-LDFLAGS=$(CPU_LDFLAGS-y) -shared --warn-common --export-dynamic --sort-common \
+LDFLAGS=$(CPU_LDFLAGS-y) -Bsymbolic -shared --warn-common --export-dynamic --sort-common \
 	-z combreloc --discard-locals --discard-all --no-undefined
 
-CSRC= ldso.c dl-startup.c
+CSRC= ldso.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 ASRC=$(shell ls $(TARGET_ARCH)/*.S)
 AOBJS=$(patsubst %.S,%.o, $(ASRC))

+ 1 - 0
ldso/ldso/ldso.c

@@ -59,6 +59,7 @@ char *_dl_debug_bindings  = 0;
 int   _dl_debug_file      = 2;
 #endif
 
+#include "dl-startup.c"
 /* Forward function declarations */
 static int _dl_suid_ok(void);