Browse files

Add Makefile support for DSBT ELF.

This adds support for a new binary format, DSBT ELF, to the Makefiles.
Every shared library is assigned a DSBT index, and the link.so macro is
adjusted to ensure the correct linker argument is passed.

Configuration and ldso support will follow in separate commits.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
  • Loading branch information...
1 parent 2a0c568 commit f4eebb6146ea3f6917481d5d24f3d99e97236399 Bernd Schmidt bernds_cb1@t-online.de committed with Bernd Schmidt Mar 2, 2011
View
3 Makerules
@@ -297,7 +297,8 @@ cmd_hcompile.o = $(HOSTCC) $(filter-out $(PHONY),$<) $(DEPS-$(notdir $@)) -c -o
define link.so
$(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
@$(disp_ld)
- $(Q)$(CC) $(LDFLAGS-$(notdir $@)) -Wl,-soname=$(notdir $@).$(2) \
+ $(Q)$(CC) $(LDFLAGS-$(notdir $@)) $(LDFLAGS-y-$(@F)) \
+ -Wl,-soname=$(notdir $@).$(2) \
$(NOSTDLIB_CFLAGS) -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) \
-Wl,--whole-archive $(firstword $^) -Wl,--no-whole-archive \
$(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
View
1 ldso/ldso/Makefile.in
@@ -30,6 +30,7 @@ CFLAGS-ldso/ldso/$(TARGET_ARCH)/ := $(CFLAGS-ldso)
CFLAGS-ldso.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\" $(CFLAGS-ldso)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-$(UCLIBC_LDSO_NAME).so := -Wl,--dsbt-index=1
ifneq ($(SUPPORT_LD_DEBUG),y)
LDFLAGS-$(UCLIBC_LDSO_NAME).so := $(LDFLAGS)
else
View
1 ldso/libdl/Makefile.in
@@ -19,6 +19,7 @@ endif
CFLAGS-libdl.c := -DLDSO_ELFINTERP=\"$(TARGET_ARCH)/elfinterp.c\"
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libdl.so := -Wl,--dsbt-index=3
LDFLAGS-libdl.so := $(LDFLAGS) -Wl,-fini,dl_cleanup
LIBS-libdl.so := $(LIBS) $(ldso)
View
1 libc/Makefile.in
@@ -15,6 +15,7 @@ ifneq ($(VERSION_SCRIPT),)
VERSION_SCRIPT := -Wl,--version-script,$(VERSION_SCRIPT)
endif
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libc.so := -Wl,--dsbt-index=2
LDFLAGS-libc.so := $(LDFLAGS) $(VERSION_SCRIPT) -Wl,-init,$(SYMBOL_PREFIX)__uClibc_init
ifeq ($(UCLIBC_HAS_STDIO_FUTEXES),y)
CFLAGS += -D__USE_STDIO_FUTEXES__
View
1 libcrypt/Makefile.in
@@ -9,6 +9,7 @@ subdirs += libcrypt
CFLAGS-libcrypt := -DNOT_IN_libc -DIS_IN_libcrypt $(SSP_ALL_CFLAGS)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libcrypt.so := -Wl,--dsbt-index=4
LDFLAGS-libcrypt.so := $(LDFLAGS)
LIBS-libcrypt.so := $(LIBS)
View
1 libm/Makefile.in
@@ -25,6 +25,7 @@ subdirs += libm
CFLAGS-libm := -DNOT_IN_libc -DIS_IN_libm $(SSP_ALL_CFLAGS)
CFLAGS-libm += -D_IEEE_LIBM
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libm.so := -Wl,--dsbt-index=5
LDFLAGS-libm.so := $(LDFLAGS)
LIBS-libm.so := $(LIBS)
View
1 libnsl/Makefile.in
@@ -9,6 +9,7 @@ subdirs += libnsl
CFLAGS-libnsl := -DNOT_IN_libc -DIS_IN_libnsl $(SSP_ALL_CFLAGS)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libnsl.so := -Wl,--dsbt-index=6
LDFLAGS-libnsl.so := $(LDFLAGS) $(call link.asneeded,-lc)
LIBS-libnsl.so := $(LIBS)
View
1 libpthread/linuxthreads.old/Makefile.in
@@ -18,6 +18,7 @@ LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -Wl,-z,defs
else
LDFLAGS-libpthread.so := $(LDFLAGS)
endif
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libpthread.so := -Wl,--dsbt-index=10
LIBS-libpthread.so := $(LIBS) $(ldso)
View
1 libresolv/Makefile.in
@@ -9,6 +9,7 @@ subdirs += libresolv
CFLAGS-libresolv := -DNOT_IN_libc -DIS_IN_libresolv $(SSP_ALL_CFLAGS)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libresolv.so := -Wl,--dsbt-index=7
LDFLAGS-libresolv.so := $(LDFLAGS) $(call link.asneeded,-lc)
LIBS-libresolv.so := $(LIBS)
View
1 librt/Makefile.in
@@ -9,6 +9,7 @@ subdirs += librt
CFLAGS-librt := -DNOT_IN_libc -DIS_IN_librt $(SSP_ALL_CFLAGS)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-librt.so := -Wl,--dsbt-index=9
LDFLAGS-librt.so := $(LDFLAGS)
LIBS-librt.so := $(LIBS)
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
View
1 libutil/Makefile.in
@@ -9,6 +9,7 @@ subdirs += libutil
CFLAGS-libutil := -DNOT_IN_libc -DIS_IN_libutil $(SSP_ALL_CFLAGS)
+LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-libutil.so := -Wl,--dsbt-index=8
LDFLAGS-libutil.so := $(LDFLAGS)
LIBS-libutil.so := $(LIBS)

0 comments on commit f4eebb6

Please sign in to comment.