From f2c33505ed4e24884b54ae012aa7b757cdd17c93 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Thu, 16 Jul 2020 13:54:47 +0200 Subject: [PATCH] initial --- objdump.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 objdump.sh diff --git a/objdump.sh b/objdump.sh new file mode 100755 index 0000000..2e18af2 --- /dev/null +++ b/objdump.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Find avr-objdump that matches the installed arduino binary +ARDUINOBIN=$(ls -l $(type -p arduino)| awk '{print $NF ; exit 0}') +PATH=$(dirname "$ARDUINOBIN")/hardware/tools/avr/bin:$PATH + +avr-objdump --private=mem-usage /tmp/arduino_build_233823/Blinkhabaplus.ino.elf + +for segment in .text .data .bss ; do + echo '++++++++++++++++++++++++++++++++++' + avr-objdump -x -C /tmp/arduino_build_233823/Blinkhabaplus.ino.elf | awk '$2 == "'$segment'" && $3 != 0 {print $3,$2} ; $4 == "'$segment'" && $5 != 0 { print $5,$6}' | sort -r +done