summaryrefslogtreecommitdiff
path: root/build-aux/lint-bin
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-02-26 14:26:28 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-02 13:30:55 -0700
commit8dc86e5ec58ec94f7ea8227ee008ded202c4204f (patch)
tree02ab6704d2ad5698c45981162cc2c192ebdee9db /build-aux/lint-bin
parent0110cae147d8b1749b4bd5763620ec73d5296a76 (diff)
libhw: Add rp2040_gpioirq, use it
Diffstat (limited to 'build-aux/lint-bin')
-rwxr-xr-xbuild-aux/lint-bin20
1 files changed, 18 insertions, 2 deletions
diff --git a/build-aux/lint-bin b/build-aux/lint-bin
index 0b955de..c487f36 100755
--- a/build-aux/lint-bin
+++ b/build-aux/lint-bin
@@ -25,7 +25,7 @@ RESET=$(tput sgr0)
err() {
printf "${RED}%s${RESET}: %s\n" "$1" "$2" >&2
- #r=1
+ r=1
}
# Input is `ld --print-map` format.
@@ -107,6 +107,21 @@ lint_stack() {
<(readelf_funcs "$in_elffile" | sed 's/\.part\.[0-9]*$//' | sort -u))
}
+lint_func_blocklist() {
+ local in_elffile
+ in_elffile=$1
+
+ local blocklist=(
+ gpio_default_irq_handler
+ )
+
+ while read -r func; do
+ err "$in_elffile" "Contains blocklisted function: ${func}"
+ done < <(readelf --syms --wide -- "$in_elffile" |
+ awk '$4 == "FUNC" { print $8 }' |
+ grep -Fx "${blocklist[@]/#/-e}")
+}
+
main() {
r=0
@@ -116,7 +131,8 @@ main() {
echo 'Global variables:'
lint_globals "${elf}.map" | sed 's/^/ /'
} > "${elf%.elf}.lint.globals"
- lint_stack "$elf" &> "${elf%.elf}.lint.stack"
+ (lint_stack "$elf") &> "${elf%.elf}.lint.stack"
+ lint_func_blocklist "$elf"
done
return $r