diff --git a/lib/Makefile b/lib/Makefile index 0c1ec54d..bb758e6f 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -31,6 +31,8 @@ $(X)BCHECK_O = bcheck.o ifeq ($(CONFIG_musl)$(CONFIG_uClibc),yes) BCHECK_O = +else + DSO_O = dsohandle.o endif ifdef CONFIG_OSX @@ -43,18 +45,18 @@ ARM_O = libtcc1.o armeabi.o alloca-arm.o armflush.o ARM64_O = lib-arm64.o WIN_O = crt1.o crt1w.o wincrt1.o wincrt1w.o dllcrt1.o dllmain.o -OBJ-i386 = $(I386_O) $(BCHECK_O) -OBJ-x86_64 = $(X86_64_O) va_list.o $(BCHECK_O) +OBJ-i386 = $(I386_O) $(BCHECK_O) $(DSO_O) +OBJ-x86_64 = $(X86_64_O) va_list.o $(BCHECK_O) $(DSO_O) OBJ-x86_64-osx = $(X86_64_O) va_list.o OBJ-i386-win32 = $(I386_O) chkstk.o bcheck.o $(WIN_O) OBJ-x86_64-win32 = $(X86_64_O) chkstk.o bcheck.o $(WIN_O) -OBJ-arm64 = $(ARM64_O) -OBJ-arm = $(ARM_O) -OBJ-arm-fpa = $(ARM_O) -OBJ-arm-fpa-ld = $(ARM_O) -OBJ-arm-vfp = $(ARM_O) -OBJ-arm-eabi = $(ARM_O) -OBJ-arm-eabihf = $(ARM_O) +OBJ-arm64 = $(ARM64_O) $(DSO_O) +OBJ-arm = $(ARM_O) $(DSO_O) +OBJ-arm-fpa = $(ARM_O) $(DSO_O) +OBJ-arm-fpa-ld = $(ARM_O) $(DSO_O) +OBJ-arm-vfp = $(ARM_O) $(DSO_O) +OBJ-arm-eabi = $(ARM_O) $(DSO_O) +OBJ-arm-eabihf = $(ARM_O) $(DSO_O) OBJ-arm-wince = $(ARM_O) $(WIN_O) $(BIN) : $(patsubst %.o,$(X)%.o,$(OBJ-$T)) diff --git a/lib/dsohandle.c b/lib/dsohandle.c new file mode 100644 index 00000000..0993dbc2 --- /dev/null +++ b/lib/dsohandle.c @@ -0,0 +1 @@ +void * __dso_handle __attribute((visibility("hidden"))) = &__dso_handle;