Newer
Older
barebox / scripts / extract_symbol_offset
@Sascha Hauer Sascha Hauer on 13 Mar 2019 255 bytes pbl multiimage: Allow to check image sizes
#!/bin/bash

symbol="$1"
file="$2"

# extract symbol offset from file, remove leading zeros
ofs=$(nm -t d $file | grep "$symbol" | cut -d ' ' -f1 | sed "s/^[0]*//")

if [ -z "${ofs}" ]; then
	echo "symbol $symbol not found in $file"
	exit 1
fi

echo $ofs