forked from rp-rs/rp2040-boot2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck-blobs.sh
executable file
·30 lines (21 loc) · 894 Bytes
/
check-blobs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Checks that the blobs are up to date with the committed assembly files
set -euxo pipefail
# We could just do `git diff --exit-code bin` but then all the feedback we get is
# Binary files a/bin/boot2_gd25q64cs.padded.bin and b/bin/boot2_gd25q64cs.padded.bin differ
# so lets dissassemble with objdump to get better feedback
git checkout bin
git clean -f bin
cargo clean
for lib in bin/*.bin; do
filename=$(basename "$lib")
arm-none-eabi-objdump -b binary -m armv6-m -M force-thumb -D "$lib" > "bin/${filename%.bin}.before"
done
UPDATE_PRECOMPILED_BINARIES=true cargo build --features=assemble
for lib in bin/*.bin; do
filename=$(basename "$lib")
arm-none-eabi-objdump -b binary -m armv6-m -M force-thumb -D "$lib" > "bin/${filename%.bin}.after"
done
for disassembly in bin/*.after; do
diff -u "$disassembly" "${disassembly%.after}.before"
done