version 1.3, 2016/09/22 21:35:25 |
version 1.4, 2016/09/22 21:37:02 |
|
|
[[ $old != "" ]] |
[[ $old != "" ]] |
} |
} |
|
|
cpu=$(uname -p) |
file_list=/tmp/{D{,S,W},J,S,U,d,j,r,s}{1,2} |
if [[ $cpu = mips64* ]] |
|
then |
|
file_list=/tmp/{D{,S,W,Y},J,S,U,d,j,r,s}{1,2} |
|
else |
|
file_list=/tmp/{D{,S,W},J,S,U,d,j,r,s}{1,2} |
|
fi |
|
|
|
if [[ $1 = "-h" ]] |
if [[ $1 = "-h" ]] |
then |
then |
|
|
readelf -sW $new | filt_symtab > /tmp/s2 |
readelf -sW $new | filt_symtab > /tmp/s2 |
|
|
|
|
|
cpu=$(uname -p) |
if [[ $cpu = mips64* ]] |
if [[ $cpu = mips64* ]] |
then |
then |
readelf -d $old >/tmp/DY1 |
gotsym1=$(readelf -d $old | awk '$2 ~ /MIPS_GOTSYM/{print $3}') |
readelf -d $new >/tmp/DY2 |
gotsym2=$(readelf -d $new | awk '$2 ~ /MIPS_GOTSYM/{print $3}') |
else |
|
rm -f /tmp/DY[12] |
|
fi |
fi |
|
|
jump_slots() { |
jump_slots() { |
case $cpu in |
case $cpu in |
hppa*) awk '/IPLT/ && $5 != ""{print $5}' /tmp/r$1 |
hppa*) awk '/IPLT/ && $5 != ""{print $5}' /tmp/r$1 |
;; |
;; |
mips*) gotsym=$(awk '$2 ~ /MIPS_GOTSYM/{print $3}' /tmp/DY$1) |
mips*) # the $((gotsym$1)) converts hex to decimal |
# the $(($foo)) is to convert hex to decimal |
awk -v g=$((gotsym$1)) \ |
awk -v g=$(($gotsym)) \ |
|
'/^Symbol table ..symtab/{exit} |
'/^Symbol table ..symtab/{exit} |
$1+0 >= g && $4 == "FUNC" {print $8}' /tmp/s$1 |
$1+0 >= g && $4 == "FUNC" {print $8}' /tmp/s$1 |
;; |
;; |
|
|
} |
} |
|
|
dynamic_sym() { |
dynamic_sym() { |
# truncate the output files, to guarantee they exist |
|
>/tmp/U$1 >/tmp/DS$1 >/tmp/DW$1 >/tmp/D$1 |
|
awk -v s=$1 '/^Symbol table ..symtab/{exit} |
awk -v s=$1 '/^Symbol table ..symtab/{exit} |
! /^ *[1-9]/ {next} |
! /^ *[1-9]/ {next} |
$7 == "UND" {print $8 | ("sort -o /tmp/U" s); next } |
$7 == "UND" {print $8 | ("sort -o /tmp/U" s); next } |