03-localize-symbol.sh (309B)
1 cat > smoke.c <<'EOF' 2 int foo(void) { return 1; } 3 int bar(void) { return foo(); } 4 EOF 5 "$KIT" cc -c smoke.c -o smoke.o 6 "$KIT" objcopy --localize-symbol=_foo smoke.o smoke.l.o 7 # Print each symbol's bind ('l' = local, 'g' = global) plus name. 8 "$KIT" objdump -t smoke.l.o | awk '$NF ~ /^_/{print $2, $NF}' | sort