mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
21 lines
476 B
Bash
Executable File
21 lines
476 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# usage: alignment.sh path to search for *.so files
|
|
|
|
dir="$1"
|
|
|
|
RED="\e[31m"
|
|
GREEN="\e[32m"
|
|
ENDCOLOR="\e[0m"
|
|
|
|
matches="$(find $dir -name "*.so" -type f)"
|
|
IFS=$'\n'
|
|
for match in $matches; do
|
|
res="$(objdump -p ${match} | grep LOAD | awk '{ print $NF }' | head -1)"
|
|
if [[ $res =~ "2**14" ]] || [[ $res =~ "2**16" ]]; then
|
|
echo -e "${match}: ${GREEN}ALIGNED${ENDCOLOR} ($res)"
|
|
else
|
|
echo -e "${match}: ${RED}UNALIGNED${ENDCOLOR} ($res)"
|
|
fi
|
|
done
|