4 # Generate a linker script for GNU ld.
20 echo "warning: $*" 1>&2
24 info "usage: $0 [-p <pattern>] [-I <ignore-list>] -o <output> <inputs>"
34 PATTERN="^mrp_|^_mrp_" # export everything prefixed with mrp_
35 IGNORE="MRP_PRINTF_LIKE,MRP_NULLTERM" # ignore these symbols/macros
36 IT="," # ignore-list is comma-separated
37 SOURCES="" # no default input, must be specified
38 OUTPUT="" # no default output, must be specified
41 while [ -n "${1#-}" ]; do
44 if [ -z "$OUTPUT" ]; then
48 error "Multiple output files requested."
68 error "Unknown option '$1'."
78 # check that we've got everything mandatory
79 if [ -z "$OUTPUT" ]; then
80 error "No output file specified (use the -o option)."
84 if [ -z "$SOURCES" ]; then
85 warning "No input files, generating local-only linker script."
93 if [ -z "$PATTERN" ]; then
97 if [ -n "$IGNORE" ]; then
98 ignore_opts="-I $IGNORE"
103 # generate the output
104 [ -n "$QUIET" ] || info "Generating linker script $OUTPUT..."
110 ctags $ignore_opts -f - --c-kinds=px $SOURCES | \
111 awk "/$PATTERN/ { print \$1; }" | \