minix/commands/scripts/datasizes.sh
Ben Gras 36e935fe0f - added 'datasizes' script that shows you the size allocated
for each symbol, usually answering those "why is does my binary have
   such a lot of BSS" questions.
 - stop binpackage looking in /var/spool for package files.
 - let makewhatis recognize .Sh as heading name
 - setup, fsck, df: allow >4kB block sizes painlessly
 - mkfs: new #-of-inodes heuristic that depends on kb, not
   on blocks; i've run out of inodes on my /usr
 - asmconv: don't silently truncate .aligns to 16 bytes
 - ipc* commands for shared memory support
2009-09-21 14:24:29 +00:00

9 lines
205 B
Bash

#!/bin/sh
if [ $# -ne 1 ]
then echo "Usage: $0 <executable>"
exit 1
fi
nm -d -n $1 | grep ' [bBdD] ' | awk '{ printf "%10ld kB %s\n", ($1-lastpos)/1024, lastname; lastpos=$1; lastname=$3 }' | sort -n