diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-02-18 08:45:53 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-02-18 08:45:53 +0000 |
commit | c35cde1edbe9d3375ed880fe8bb7d0fffba2f000 (patch) | |
tree | 8eb890508a7c6f00aeaa035dbb23a687e0a4cae4 /libc | |
parent | 5305b3df0ac3b6970947180fa9b2fcad0b6e6364 (diff) |
Make shared libs properly list the correct ld.so in the interp
field by being sneaky.
Diffstat (limited to 'libc')
-rw-r--r-- | libc/Makefile | 3 | ||||
-rw-r--r-- | libc/misc/internals/Makefile | 15 |
2 files changed, 14 insertions, 4 deletions
diff --git a/libc/Makefile b/libc/Makefile index 0d5d758eb..a393b6d9f 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -47,7 +47,8 @@ shared: $(TOPDIR)lib/$(LIBNAME) @(cd tmp && CC=$(CC) LD=$(LD) NM=$(NM) AR=$(AR) \ /bin/sh ../../extra/scripts/get-needed-libgcc-objects.sh) $(LD) $(LDFLAGS) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \ - --whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive $(LDSO) + --whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive \ + $(TOPDIR)/libc/misc/internals/interp.o @/bin/true #rm -rf tmp install -d $(TOPDIR)lib rm -f $(TOPDIR)lib/$(SHARED_FULLNAME) diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index 8e4d160a9..29ffdec7b 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -35,17 +35,26 @@ endif COBJS=$(patsubst %.c,%.o, $(CSRC)) OBJS=$(COBJS) -all: $(OBJS) $(LIBC) +all: $(OBJS) interp.o $(LIBC) -$(LIBC): ar-target +$(LIBC): interp.c ar-target ar-target: $(OBJS) $(AR) $(ARFLAGS) $(LIBC) $(OBJS) +interp.c: Makefile + echo "/* Force shared libraries to know about the correct library loader */" > interp.c + echo "const char __dl_ldso__[] __attribute__ ((section " \ + "(\".interp\"))) =\""$(DYNAMIC_LINKER)"\";" >> interp.c + $(COBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o +interp.o: %.o : %.c + $(CC) $(CFLAGS) -c $< -o $@ + $(STRIPTOOL) -x -R .note -R .comment $*.o + clean: - rm -f *.[oa] *~ core + rm -f *.[oa] interp.c *~ core |