Mercurial > hg > CbC > CbC_gcc
comparison contrib/compare-debug @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | 855418dad1a3 |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
55 suf2=$suf2. | 55 suf2=$suf2. |
56 done | 56 done |
57 | 57 |
58 trap 'rm -f "$1.$suf1" "$2.$suf2"' 0 1 2 15 | 58 trap 'rm -f "$1.$suf1" "$2.$suf2"' 0 1 2 15 |
59 | 59 |
60 cp "$1" "$1.$suf1" | 60 case `uname -s` in |
61 strip "$1.$suf1" | 61 Darwin) |
62 ld -S -x -r -no_uuid "$1" -o "$1.$suf1" | |
63 ld -S -x -r -no_uuid "$2" -o "$2.$suf2" | |
64 ;; | |
65 *) | |
66 cp "$1" "$1.$suf1" | |
67 strip "$1.$suf1" | |
62 | 68 |
63 cp "$2" "$2.$suf2" | 69 cp "$2" "$2.$suf2" |
64 strip "$2.$suf2" | 70 strip "$2.$suf2" |
71 ;; | |
72 esac | |
65 | 73 |
66 if cmp "$1.$suf1" "$2.$suf2"; then | 74 if cmp "$1.$suf1" "$2.$suf2"; then |
67 status=0 | 75 status=0 |
68 else | 76 else |
69 status=1 | 77 status=1 |
76 cmd= | 84 cmd= |
77 cmp1= | 85 cmp1= |
78 cmp2= | 86 cmp2= |
79 | 87 |
80 for t in objdump readelf eu-readelf; do | 88 for t in objdump readelf eu-readelf; do |
81 if ($t --help) 2>&1 | grep -e '--\[*section-\]*headers' > /dev/null; then | 89 if ($t --help) 2>&1 | grep ' --\[*section-\]*headers' > /dev/null; then |
82 cmd=$t | 90 cmd=$t |
83 | 91 |
84 $cmd --section-headers "$1.$suf1" | grep '\.eh_frame' > /dev/null | 92 $cmd --section-headers "$1.$suf1" | grep '\.eh_frame' > /dev/null |
85 cmp1=$? | 93 cmp1=$? |
86 | 94 |
107 | 115 |
108 trap 'rm -f "$1.$suf1" "$2.$suf2" "$1.$suf3" "$2.$suf4"' 0 1 2 15 | 116 trap 'rm -f "$1.$suf1" "$2.$suf2" "$1.$suf3" "$2.$suf4"' 0 1 2 15 |
109 | 117 |
110 echo stripping off .eh_frame, then retrying >&2 | 118 echo stripping off .eh_frame, then retrying >&2 |
111 | 119 |
112 if (objcopy -v) 2>&1 | grep -e "--remove-section" > /dev/null; then | 120 if (objcopy -v) 2>&1 | grep ' --remove-section' > /dev/null; then |
113 objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$1.$suf1" "$1.$suf3" | 121 objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$1.$suf1" "$1.$suf3" |
114 mv "$1.$suf3" "$1.$suf1" | 122 mv "$1.$suf3" "$1.$suf1" |
115 | 123 |
116 objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$2.$suf2" "$2.$suf4" | 124 objcopy --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$2.$suf2" "$2.$suf4" |
117 mv "$2.$suf4" "$2.$suf2" | 125 mv "$2.$suf4" "$2.$suf2" |
118 elif (strip --help) 2>&1 | grep -e --remove-section > /dev/null; then | 126 elif (strip --help) 2>&1 | grep ' --remove-section' > /dev/null; then |
119 cp "$1.$suf1" "$1.$suf3" | 127 cp "$1.$suf1" "$1.$suf3" |
120 strip --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$1.$suf3" | 128 strip --remove-section .eh_frame --remove-section .rel.eh_frame --remove-section .rela.eh_frame "$1.$suf3" |
121 mv "$1.$suf3" "$1.$suf1" | 129 mv "$1.$suf3" "$1.$suf1" |
122 | 130 |
123 cp "$2.$suf2" "$2.$suf4" | 131 cp "$2.$suf2" "$2.$suf4" |
139 | 147 |
140 $rm "$1.$suf1" "$2.$suf2" | 148 $rm "$1.$suf1" "$2.$suf2" |
141 | 149 |
142 trap "exit $status; exit" 0 1 2 15 | 150 trap "exit $status; exit" 0 1 2 15 |
143 | 151 |
152 if test -f "$1".gkd || test -f "$2".gkd; then | |
153 if cmp "$1".gkd "$2".gkd; then | |
154 : | |
155 else | |
156 status=$? | |
157 fi | |
158 fi | |
159 | |
144 exit $status | 160 exit $status |