Talk:Development

From dreamcast.wiki
Jump to navigation Jump to search

dumping size of symbols from an elf with scary oneliners


Common Symbols:
awk '/Allocating common symbols/ {print "Start: "FNR}' output.map && awk '/Memory Configuration/ {print "End: "FNR}' output.map
gawk --non-decimal-data '{ $1 = sprintf("%d\t"$1, $2) } (FNR>412 && FNR<1093)' output.map | sort -n
OR
echo 'gawk --non-decimal-data '"'"'{ $1 = sprintf("%d\t"$1, $2) } (FNR>'`awk '/Allocating common symbols/ {print FNR}' output.map`' && FNR<'`awk '/Memory Configuration/ {print FNR}' output.map`')'"'"' output.map | sort -n' | sh

BSS area:
awk '/ \*\(\.bss\)/ {print "Start: "FNR}' output.map && awk '/ \*\(\.bss\.\*\)/ {print "End: "FNR}' output.map
gawk --non-decimal-data '{ $1 = sprintf("%d\t"$1, $3) } (FNR>4642 && FNR<4720)' output.map | sort -n
OR
echo 'gawk --non-decimal-data '"'"'{ $1 = sprintf("%d\t"$1, $3) } (FNR>'`awk '/ \*\(\.bss\)/ {print FNR}' output.map`' && FNR<'`awk '/ \*\(\.bss\.\*\)/ {print FNR}' output.map`')'"'"' output.map | sort -n' | sh

RODATA:
awk '/ \*\(\.rodata\)/ {print "Start: "FNR}' output.map && awk '/ \*\(\.rodata\.\*\)/ {print "End: "FNR}' output.map
gawk --non-decimal-data '{ $1 = sprintf("%d\t"$1, $3) } (FNR>3892 && FNR<4112)' output.map | sort -n
OR
echo 'gawk --non-decimal-data '"'"'{ $1 = sprintf("%d\t"$1, $3) } (FNR>'`awk '/ \*\(\.rodata\)/ {print FNR}' output.map`' && FNR<'`awk '/ \*\(\.rodata\.\*\)/ {print FNR}' output.map`')'"'"' output.map | sort -n' | sh

--Neo (talk) 13:50, 8 April 2020 (CDT)