diff options
author | comex | 2015-07-07 15:19:20 -0400 |
---|---|---|
committer | comex | 2015-07-07 15:19:20 -0400 |
commit | 69752843f1b6460ebb23584401661613d0b5bacf (patch) | |
tree | 33e13dc21a4335aeb1cc114a5bddecdcc7628da3 /script/gen-inject-asm.sh | |
parent | ... (diff) | |
download | substitute-69752843f1b6460ebb23584401661613d0b5bacf.tar.gz |
tests
Diffstat (limited to 'script/gen-inject-asm.sh')
-rwxr-xr-x | script/gen-inject-asm.sh | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/script/gen-inject-asm.sh b/script/gen-inject-asm.sh index 161bbe7..633a1a5 100755 --- a/script/gen-inject-asm.sh +++ b/script/gen-inject-asm.sh @@ -1,5 +1,7 @@ #!/bin/sh -cat <<END +outfile="$1" +shift +(cat <<END /* Generated by script/gen-inject-asm.sh. The relevant source is in-tree (make * out/darwin-inject-asm.S), but this file has been checked in too, in case * your C compiler doesn't support all of these architectures. @@ -13,12 +15,11 @@ cat <<END .globl _inject_page_start _inject_page_start: END -outfile="$1" -shift -(for fn in "$@"; do - echo ".align 2" - echo ".globl _inject_start_$i" - echo "_inject_start_$i:" - printf ".byte " - xxd -i < "$fn" | xargs echo +while [ -n "$1" ]; do + echo ".align 2" + echo ".globl _inject_start_$1" + echo "_inject_start_$1:" + printf ".byte " + xxd -i < "$2" | xargs echo + shift 2 done) > "$outfile" |