summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-06-17 16:20:25 +0000
committerMiles Bader <miles@gnu.org>1997-06-17 16:20:25 +0000
commit34ad8f14ad84fbdf0bec27d145c394b0a85234c5 (patch)
tree0b81f376a56ed42ead3acceeb8f24e24b369cf90
parent334add09dac162b214c34bf5fef9cd99d780f3d8 (diff)
Initial checkin
-rwxr-xr-xrelease/mkemptyso5
-rw-r--r--release/mksmallso35
2 files changed, 11 insertions, 29 deletions
diff --git a/release/mkemptyso b/release/mkemptyso
new file mode 100755
index 00000000..0260a48e
--- /dev/null
+++ b/release/mkemptyso
@@ -0,0 +1,5 @@
+#!/bin/sh
+# args: $1 -- destination .so file
+SO=$1
+GCC=${GCC-i386-gnu-gcc}
+$GCC -nostdlib -shared -fPIC -x c /dev/null -Wl,-soname=`basename $SO` -o $SO
diff --git a/release/mksmallso b/release/mksmallso
index 45707dbe..a39a24db 100644
--- a/release/mksmallso
+++ b/release/mksmallso
@@ -1,19 +1,10 @@
# Usage:
# $1 : Destination merged, stripped, small shared library
# $2 : lib*_pic.a files from which to produce the final small library
-# $3 : .so files that this library should depend on
-# ${4:$} : executables and shared libraries whos dependencies we care about
-
-while :; do
- case "$1" in
- -*) LDARGS="$1"; shift;;
- *) break;;
- esac
-done
+# ${3:$} : executables and shared libraries whos dependencies we care about
MERGED_SO="$1"; shift
PIC_LIBS="$1"; shift
-DEPS="$1"; shift
GCC=${GCC-i386-gnu-gcc}
LD=${LD-i386-gnu-ld}
@@ -21,28 +12,14 @@ OBJDUMP=${OBJDUMP-i386-gnu-objdump}
OBJCOPY=${OBJCOPY-i386-gnu-objcopy}
DEP_FLAGS_FILE=/tmp/,depflags.$$
-NEED_DSYMS_FILE=/tmp/,need.dyn.syms.$$
-HAVE_DSYMS_FILE=/tmp/,have.dyn.syms.$$
MERGED_PIC_LIB=/tmp/,libmerged_pic.a.$$
-#trap "rm -f $DEP_FLAGS_FILE $MERGED_PIC_LIB $NEED_DSYMS_FILE $HAVE_DSYMS_FILE" 0
-
-
-$OBJDUMP --dynamic-syms "$@" 2>/dev/null \
- | sed -n 's/^.*\*UND\*.* \([^ ]*\)$/\1/p' \
- | sort -u > $NEED_DSYMS_FILE
-
-# 00000000 w F .text 00000000 syscall_device_write_request
-# 00000000 g F .text 0000056c __strtoq_internal
-$OBJDUMP --syms $PIC_LIBS 2>/dev/null \
- | sed -n 's/^........ \(g \| w\) .. .* [0-9a-f]....... \([^ ]*\)$/\2/p' \
- | sort -u > $HAVE_DSYMS_FILE
+#trap "rm -f $DEP_FLAGS_FILE $MERGED_PIC_LIB" 0
-# This had better be gnu diff...
-diff --unchanged-l='%L' --old-l= --new-l= $NEED_DSYMS_FILE $HAVE_DSYMS_FILE \
- | sed 's/^/-u/' > $DEP_FLAGS_FILE
+$OBJDUMP --dynamic-syms "$@" 2>/dev/null|sed -n 's/^.*\*UND\*.* \([^ ]*\)$/-u\1/p'|sort -u > $DEP_FLAGS_FILE
-$GCC $LDARGS -nostdlib -nostartfiles -shared -Wl,-soname=`basename $MERGED_SO` `cat $DEP_FLAGS_FILE` \
- -o $MERGED_SO.uns $PIC_LIBS $DEPS \
+$LD -o $MERGED_PIC_LIB `cat $DEP_FLAGS_FILE` -r $PIC_LIBS \
+&& $GCC -nostdlib -shared -Wl,-soname=`basename $MERGED_SO` \
+ -o $MERGED_SO.uns $MERGED_PIC_LIB \
&& $OBJCOPY --strip-debug $MERGED_SO.uns $MERGED_SO \
&& rm -f $MERGED_SO.uns