summaryrefslogtreecommitdiff
path: root/build-aux/lint-bin
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-12 08:34:19 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-04-12 08:34:19 -0600
commitddd3f3982c6cdf8d7d0068e544cc9daf24355d32 (patch)
tree747821d810bf6ecb97089af088e3946cfc1225ce /build-aux/lint-bin
parentd053a0f6dffc575611324b81acaef0d1554bda6c (diff)
parente0d67aeb886c75dde8f05120a2d8d1bd2dd2c16c (diff)
Merge branch 'lukeshu/tidy'
Diffstat (limited to 'build-aux/lint-bin')
-rwxr-xr-xbuild-aux/lint-bin15
1 files changed, 8 insertions, 7 deletions
diff --git a/build-aux/lint-bin b/build-aux/lint-bin
index 78ed19f..91f1612 100755
--- a/build-aux/lint-bin
+++ b/build-aux/lint-bin
@@ -62,7 +62,7 @@ lint_globals() {
cd "$rel_base"
total=0
while read -r symbol addr size source; do
- if (( addr == 0 )); then
+ if ((addr == 0)); then
continue
fi
case "$source" in
@@ -103,8 +103,9 @@ lint_stack() {
fi
done < <(
comm -3 \
- <(sed -En 's/^included: (.*:)?//p' "${in_elffile%.elf}_stack.c" | sort -u) \
- <(readelf_funcs "$in_elffile" | sed -E -e 's/\.part\.[0-9]*$//' -e 's/^__(.*)_veneer$/\1/' | sort -u))
+ <(sed -En 's/^included: (.*:)?//p' "${in_elffile%.elf}_stack.c" | sort -u) \
+ <(readelf_funcs "$in_elffile" | sed -E -e 's/\.part\.[0-9]*$//' -e 's/^__(.*)_veneer$/\1/' | sort -u)
+ )
}
lint_func_blocklist() {
@@ -118,8 +119,8 @@ lint_func_blocklist() {
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}")
+ awk '$4 == "FUNC" { print $8 }' |
+ grep -Fx "${blocklist[@]/#/-e}")
}
main() {
@@ -130,8 +131,8 @@ main() {
{
echo 'Global variables:'
lint_globals "${elf}.map" | sed 's/^/ /'
- } > "${elf%.elf}.lint.globals"
- (lint_stack "$elf") &> "${elf%.elf}.lint.stack"
+ } >"${elf%.elf}.lint.globals"
+ (lint_stack "$elf") &>"${elf%.elf}.lint.stack"
lint_func_blocklist "$elf"
done