Skip to content

Commit 3d3424e

Browse files
committed
Refine .cfi_sections check to only consider compact eh_frame
The .cfi_sections directive can be safely used multiple times with different sections named at any time unless the compact form of exception handling is requested after CFI information has been emitted. Only the compact form of CFI information changes the way in which CFI is generated and therefore cannot be retrospectively requested after generating CFI information. gas/ PR gas/20648 * dw2gencfi.c (dot_cfi_sections): Refine the check for inconsistent .cfi_sections to only consider compact vs non compact forms. * testsuite/gas/cfi/cfi-common-9.d: New file. * testsuite/gas/cfi/cfi-common-9.s: New file. * testsuite/gas/cfi/cfi.exp: Run new test.
1 parent ee8da4b commit 3d3424e

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

gas/ChangeLog

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2016-10-06 Matthew Fortune <[email protected]>
2+
3+
PR gas/20648
4+
* dw2gencfi.c (dot_cfi_sections): Refine the check for
5+
inconsistent .cfi_sections to only consider compact vs non
6+
compact forms.
7+
* testsuite/gas/cfi/cfi-common-9.d: New file.
8+
* testsuite/gas/cfi/cfi-common-9.s: New file.
9+
* testsuite/gas/cfi/cfi.exp: Run new test.
10+
111
2016-10-06 Alan Modra <[email protected]>
212

313
* app.c: Add missing fall through comments.

gas/dw2gencfi.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,10 @@ dot_cfi_sections (int ignored ATTRIBUTE_UNUSED)
12691269
}
12701270

12711271
demand_empty_rest_of_line ();
1272-
if (cfi_sections_set && cfi_sections != sections)
1272+
if (cfi_sections_set
1273+
&& (sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact))
1274+
&& (cfi_sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact))
1275+
!= (sections & (CFI_EMIT_eh_frame | CFI_EMIT_eh_frame_compact)))
12731276
as_bad (_("inconsistent uses of .cfi_sections"));
12741277
cfi_sections = sections;
12751278
}

gas/testsuite/gas/cfi/cfi-common-9.d

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#objdump: -Wf
2+
#name: CFI common 9
3+
#...
4+
Contents of the .eh_frame section:
5+
6+
00000000 0+0010 0+0000 CIE
7+
Version: 1
8+
Augmentation: "zR"
9+
Code alignment factor: .*
10+
Data alignment factor: .*
11+
Return address column: .*
12+
Augmentation data: [01]b
13+
14+
DW_CFA_nop
15+
DW_CFA_nop
16+
DW_CFA_nop
17+
18+
00000014 0+00(10|18|1c|20) 0+0018 FDE cie=0+0000 pc=.*
19+
20+
DW_CFA_nop
21+
DW_CFA_nop
22+
DW_CFA_nop
23+
#...

gas/testsuite/gas/cfi/cfi-common-9.s

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.cfi_sections .eh_frame
2+
.cfi_startproc simple
3+
.cfi_sections .debug_frame
4+
.cfi_endproc

gas/testsuite/gas/cfi/cfi.exp

+1
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,5 @@ if { ![istarget "hppa64*-*"] } then {
136136
}
137137
run_dump_test "cfi-common-7"
138138
run_dump_test "cfi-common-8"
139+
run_dump_test "cfi-common-9"
139140
}

0 commit comments

Comments
 (0)