elflink: set the sonames of shared libraries
authorH. Peter Anvin <hpa@linux.intel.com>
Thu, 3 Jan 2013 17:29:51 +0000 (09:29 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Thu, 3 Jan 2013 17:29:51 +0000 (09:29 -0800)
Set the sonames of shared libraries to the filename, so we don't end
up with full pathnames embedded in the files.

com32/elflink/ldlinux/Makefile
com32/gpllib/Makefile
com32/lib/Makefile
com32/libutil/Makefile

index 93ca127..43ea632 100644 (file)
@@ -22,7 +22,7 @@ all: ldlinux.c32 ldlinux_lnx.a
 ldlinux.c32 : ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o \
                adv.o execute.o chainboot.o kernel.o get_key.o \
                advwrite.o setadv.o eprintf.o loadhigh.o msg.o
-       $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
+       $(LD) $(LDFLAGS) -soname $(@F) -o $@ $^ $(LIBS)
 
 LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
 LNXLIBOBJS = get_key.lo
index 92dd20f..053e864 100644 (file)
@@ -22,7 +22,7 @@ COM32DIR = $(AUXDIR)/com32
 all: libcom32gpl.c32
 
 libcom32gpl.c32 : $(LIBOBJS)
-       $(LD) -shared $(LDFLAGS) -o $@ $^
+       $(LD) -shared $(LDFLAGS) -soname $(@F) -o $@ $^
 
 tidy dist clean:
        find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \
index 84f65c1..7806230 100644 (file)
@@ -216,7 +216,7 @@ all: libcom32.c32 libcom32min.a libcom32core.a
 
 libcom32.c32 : $(LIBOBJS)
        rm -f $@
-       $(LD) -shared $(LDFLAGS) -o $@ $^
+       $(LD) -shared $(LDFLAGS) -soname $(@F) -o $@ $^
 
 libcom32min.a : $(MINLIBOBJS)
        rm -f $@
index 93c0c11..fb437dc 100644 (file)
@@ -42,7 +42,7 @@ LNXLIBOBJS = $(patsubst %.o,%.lo,$(LIBOBJS))
 all: libutil_com.c32 libutil_lnx.a
 
 libutil_com.c32: $(LIBOBJS)
-       $(LD) $(LDFLAGS) -o $@ $^
+       $(LD) $(LDFLAGS) -soname $(@F) -o $@ $^
 
 libutil_lnx.a: $(LNXLIBOBJS)
        rm -f $@