From 940734e1eeace5e840cb982cf9a5ac2cf94e1ddf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Mon, 14 Jan 2002 15:59:26 +0100 Subject: [PATCH] New file. Rev: src/nettle/list-obj-sizes.awk:1.1 --- list-obj-sizes.awk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 list-obj-sizes.awk diff --git a/list-obj-sizes.awk b/list-obj-sizes.awk new file mode 100755 index 00000000..b9093a27 --- /dev/null +++ b/list-obj-sizes.awk @@ -0,0 +1,25 @@ +#! /usr/bin/gawk -f + +# Run this filter on the output of +# +# objdump -h libnettle.a + +BEGIN { + print "file text-size data-size rodata-size"; + text_total = 0; + data_total = 0; + rodata_total = 0; +} + +/elf32/ { name = $1; text_size = data_size = rodata_size = 0; } +/\.text/ { text_size = $3 } +/\.data/ { data_size = $3; } +/\.rodata/ { rodata_size = $3; } +/\.comment/ { + printf "%15s %s %s %s\n", name, text_size, data_size, rodata_size; +} + +END { + printf "%15s %s %s %s\n", "TOTAL", text_total, data_total, rodata_total; +} + -- GitLab