mirror of
https://git.busybox.net/uClibc
synced 2025-10-14 01:32:00 +08:00
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>
This commit is contained in:

committed by
Bernd Schmidt

parent
2a0c568ddc
commit
f4eebb6146
@@ -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 $@))
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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__
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user