1 2 3 4 5 6
#!/bin/sh nm --format=posix "$@" | sed -n -E \ -e 's/(.*_(end|start)) D .*/extern char \1[];/p' \ -e 's/(.*_size) A .*/extern size_t \1;/p'