6 echo "usage: genassym [-o outfile] objfile"
13 ${NM:='nm'} "$1" |
${AWK:='awk'} '
15 sign = substr($1, length($1) - 3, 4)
21 w0 = substr($1, length($1) - 3, 4)
24 w1 = substr($1, length($1) - 3, 4)
27 w2 = substr($1, length($1) - 3, 4)
30 w3 = substr($1, length($1) - 3, 4)
36 # This still has minor problems representing INT_MIN, etc.
38 # with 32-bit 2''s complement ints, this prints -0x80000000,
39 # which has the wrong type (unsigned int).
40 printf("#define\t%s\t%s0x%s\n", $3, sign, w)
49 while getopts "o:" option
57 shift $
(($OPTIND - 1))
63 if [ "$use_outfile" = "yes" ]
65 work
$1 3>"$outfile" >&3 3>&-