Module Name:    src
Committed By:   christos
Date:           Wed Nov 12 02:15:58 UTC 2014

Modified Files:
        src/sys/conf: mkldscript.sh

Log Message:
I don't know what was using this before (but it did not work since it
did not produce valid LDSCRIPT code) and now it does.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/conf/mkldscript.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/mkldscript.sh
diff -u src/sys/conf/mkldscript.sh:1.1 src/sys/conf/mkldscript.sh:1.2
--- src/sys/conf/mkldscript.sh:1.1	Sat Mar  3 21:35:49 2007
+++ src/sys/conf/mkldscript.sh	Tue Nov 11 21:15:58 2014
@@ -1,15 +1,21 @@
 #!/bin/sh
-#	$NetBSD: mkldscript.sh,v 1.1 2007/03/04 02:35:49 tsutsui Exp $
+#	$NetBSD: mkldscript.sh,v 1.2 2014/11/12 02:15:58 christos Exp $
 
-TEMPLATE=$1
+TEMPLATE="$1"
 shift
 
-SETS=`$OBJDUMP -x $* | fgrep "RELOCATION RECORDS FOR [link_set" | \
-        sort -u | sed 's/^.*\[\(.*\)\]:$/\1/'`
+mksets() {
+    "${OBJDUMP:-objdump}" -x "$@" | fgrep "RELOCATION RECORDS FOR [link_set" | \
+        sort -u | sed 's/^.*\[\(.*\)\]:$/\1/'
+}
+SETS=$(mksets "$@")
 
+
+grep -v '^}$' "$TEMPLATE"
 for s in $SETS; do
-        printf "    . = ALIGN(4);\n"
-        printf "    PROVIDE (__start_%s = .);\n" $s
-        printf "    *(%s)\n" $s
-        printf "    PROVIDE (__stop_%s = .);\n" $s
-done 
+        printf '   . = ALIGN(4);\n'
+        printf '   PROVIDE (__start_%s = .);\n' $s
+        printf '   %s : { *(%s) }\n' $s $s
+        printf '   PROVIDE (__stop_%s = .);\n' $s
+done
+printf '}\n'

Reply via email to