Commit | Line | Data |
---|---|---|
8ca751ee L |
1 | #!/bin/sh |
2 | ||
3 | # pr26936.sh -- Tests for relocations in debug sections against linkonce | |
4 | # and comdat sections. | |
5 | ||
250d07de | 6 | # Copyright (C) 2020-2021 Free Software Foundation, Inc. |
8ca751ee L |
7 | |
8 | # This file is part of gold. | |
9 | ||
10 | # This program is free software; you can redistribute it and/or modify | |
11 | # it under the terms of the GNU General Public License as published by | |
12 | # the Free Software Foundation; either version 3 of the License, or | |
13 | # (at your option) any later version. | |
14 | ||
15 | # This program is distributed in the hope that it will be useful, | |
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | # GNU General Public License for more details. | |
19 | ||
20 | # You should have received a copy of the GNU General Public License | |
21 | # along with this program; if not, write to the Free Software | |
22 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
23 | # MA 02110-1301, USA. | |
24 | ||
25 | set -e | |
26 | ||
27 | check() | |
28 | { | |
29 | number_of_occurrence=`egrep "$2" ./$1 -o| wc -l` | |
30 | if [ $number_of_occurrence != $3 ] | |
31 | then | |
32 | echo "$1: \"$2\" $3: Failed" | |
33 | status=1 | |
34 | fi | |
35 | } | |
36 | ||
37 | status=0 | |
38 | check pr26936a.stdout "^pr26936a.s +6 +0x10108 +x" 1 | |
39 | check pr26936a.stdout "^pr26936b.s +5 +0x10109 +x" 1 | |
40 | check pr26936a.stdout "^pr26936b.s +11 +0x10108 +x" 1 | |
41 | check pr26936a.stdout "^pr26936c.s +6 +0x10108 +x" 1 | |
42 | check pr26936a.stdout "^ +0+10108 0+1" 3 | |
43 | check pr26936a.stdout "^ +0+10109 0+1" 1 | |
44 | check pr26936a.stdout "^ +0+ 0+10109 0+1010a" 1 | |
45 | check pr26936a.stdout "^ +0+ 0+10108 0+10109" 1 | |
46 | check pr26936b.stdout "^pr26936d.s +6 +0x10108 +x" 1 | |
47 | check pr26936b.stdout "^pr26936b.s +5 +0x10109 +x" 1 | |
48 | check pr26936b.stdout "^pr26936b.s +11 +0x10108 +x" 1 | |
49 | check pr26936b.stdout "^pr26936c.s +6 +0x10108 +x" 1 | |
50 | check pr26936b.stdout "^ +0+10108 0+1" 3 | |
51 | check pr26936b.stdout "^ +0+10109 0+1" 1 | |
52 | check pr26936b.stdout "^ +0+ 0+10109 0+1010a" 1 | |
53 | check pr26936b.stdout "^ +0+ 0+10108 0+10109" 1 | |
54 | ||
55 | exit $status |