summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-12 08:51:21 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-12 08:51:21 +0000
commit3368dbc3ed56f8746c74b277c01dfcdf1e0c9c1f (patch)
tree6ad5d5b2f06e8313b993233fddb244546cd1fb42 /ldso
parent9b906508889607b50e2b636bdf5602cad903fc68 (diff)
Based on a problem report and patch from Florian Schirmer, fix a compile
problem with mips -- contrary to my expectation gcc on mips _always_ defines __PIC__ which breaks the assumption inherent in my code. This should fix things up.
Diffstat (limited to 'ldso')
-rw-r--r--ldso/libdl/Makefile2
-rw-r--r--ldso/libdl/libdl.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/ldso/libdl/Makefile b/ldso/libdl/Makefile
index b883fc062..55fff3988 100644
--- a/ldso/libdl/Makefile
+++ b/ldso/libdl/Makefile
@@ -34,7 +34,7 @@ endif
XXFLAGS+=$(shell $(CC) -print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp")
XXFLAGS_NOPIC:=$(XXFLAGS)
ifeq ($(DOPIC),y)
- XXFLAGS += $(PICFLAG)
+ XXFLAGS += $(PICFLAG) -D__LIBDL_SHARED__
endif
ifeq ($(strip $(SUPPORT_LD_DEBUG)),y)
XXFLAGS+=-D__SUPPORT_LD_DEBUG__
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index f7411cd25..f3bc89abd 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -16,7 +16,7 @@ int dladdr(void *, Dl_info *) __attribute__ ((__weak__, __alias__ ("_dladdr")));
void _dlinfo(void);
-#ifdef __PIC__
+#if defined (__LIBDL_SHARED__)
/* This is a real hack. We need access to the dynamic linker, but we
also need to make it possible to link against this library without any
unresolved externals. We provide these weak symbols to make the link
@@ -64,7 +64,7 @@ extern char *_dl_debug_bindings __attribute__ ((__weak__, __alias__ ("foobar1"))
extern int _dl_debug_file __attribute__ ((__weak__, __alias__ ("foobar1")));
#endif
-#else /* __PIC__ */
+#else /* __LIBDL_SHARED__ */
#ifdef __SUPPORT_LD_DEBUG__
char *_dl_debug = 0;
@@ -285,7 +285,7 @@ void *_dlopen(const char *libname, int flag)
_dlinfo();
#endif
-#ifdef __PIC__
+#if defined (__LIBDL_SHARED__)
/* Find the last library so we can run things in the right order */
for (tpnt = dyn_chain->dyn; tpnt->next!=NULL; tpnt = tpnt->next)
;