diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-26 14:26:28 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-03-02 13:30:55 -0700 |
commit | 8dc86e5ec58ec94f7ea8227ee008ded202c4204f (patch) | |
tree | 02ab6704d2ad5698c45981162cc2c192ebdee9db /build-aux/lint-bin | |
parent | 0110cae147d8b1749b4bd5763620ec73d5296a76 (diff) |
libhw: Add rp2040_gpioirq, use it
Diffstat (limited to 'build-aux/lint-bin')
-rwxr-xr-x | build-aux/lint-bin | 20 |
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 |