3 # pr23016_1.sh -- check that .eh_frame sections and their relocations
4 # are merged together even when mixing SHT_PROGBITS and SHT_X86_64_UNWIND.
6 # Copyright (C) 2018-2023 Free Software Foundation, Inc.
7 # Written by Cary Coutant <ccoutant@gmail.com>.
9 # This file is part of gold.
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
37 /\.eh_frame *PROGBITS/ {
40 /\.eh_frame *X86_64_UNWIND/ {
43 /^Relocation section .\.rela\.eh_frame/ {
46 /R_X86_64_64.*x \+ 0/ {
49 /R_X86_64_64.*y \+ 0/ {
56 printf "%s: There should be no .eh_frame sections of type PROGBITS.\n", FILE;
61 printf "%s: There should be exactly one .eh_frame section of type X86_64_UNWIND.\n", FILE;
66 printf "%s: There should be exactly one .rela.eh_frame relocation section.\n", FILE;
71 printf "%s: There should be exactly one relocation for x.\n", FILE;
76 printf "%s: There should be exactly one relocation for y.\n", FILE;
84 check pr23016_1.stdout
85 check pr23016_1r.stdout