aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-07 22:32:52 +1030
committerAlan Modra <amodra@gmail.com>2019-12-08 22:03:53 +1030
commitbc754168c7c3fc64e40bb7ddd97ea1ad07fb32d2 (patch)
tree7ad59eaed63d19869be1254f850dac48a42f968a /ld
parentc14aab8cd3135a86915f4be4ea711b30de674bb3 (diff)
downloadgdb-bc754168c7c3fc64e40bb7ddd97ea1ad07fb32d2.zip
gdb-bc754168c7c3fc64e40bb7ddd97ea1ad07fb32d2.tar.gz
gdb-bc754168c7c3fc64e40bb7ddd97ea1ad07fb32d2.tar.bz2
Optional matching for run_dump_test
This adds an alternative to using #... in dump files, useful where we only want to allow specific extra output. DW_CFA_nop in CIEs and FDEs to pad out to required alignment (larger for 64-bit than 32-bit) is an example where these optional match patterns are useful. binutils/ * testsuite/lib/binutils-common.exp (regexp_diff): Support #?REGEXP. ld/ * testsuite/ld-elf/eh4.d: Match optional padding DW_CFA_nop in FDEs. * testsuite/ld-elf/eh5.d: Likewise, and extra CIEs emitted on embedded targets.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/testsuite/ld-elf/eh4.d6
-rw-r--r--ld/testsuite/ld-elf/eh5.d60
3 files changed, 63 insertions, 9 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8c07ff6..a704214 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2019-12-08 Alan Modra <amodra@gmail.com>
+
+ * testsuite/ld-elf/eh4.d: Match optional padding DW_CFA_nop in FDEs.
+ * testsuite/ld-elf/eh5.d: Likewise, and extra CIEs emitted on
+ embedded targets.
+
2019-12-06 Alan Modra <amodra@gmail.com>
* testsuite/ld-mips-elf/eh-frame1-n32.d: Pass --eh-frame-hdr to ld.
diff --git a/ld/testsuite/ld-elf/eh4.d b/ld/testsuite/ld-elf/eh4.d
index 391efb8..f33431a 100644
--- a/ld/testsuite/ld-elf/eh4.d
+++ b/ld/testsuite/ld-elf/eh4.d
@@ -34,6 +34,10 @@ Contents of the .eh_frame section:
DW_CFA_def_cfa_offset: 24
DW_CFA_advance_loc: [0-9a-f]+ to [0-9a-f]+
DW_CFA_def_cfa_expression \(DW_OP_breg7 \(rsp\): 8; DW_OP_breg16 \(rip\): 0;.*
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
[0-9a-f]+ ZERO terminator
#pass
diff --git a/ld/testsuite/ld-elf/eh5.d b/ld/testsuite/ld-elf/eh5.d
index e61db61..4a69748 100644
--- a/ld/testsuite/ld-elf/eh5.d
+++ b/ld/testsuite/ld-elf/eh5.d
@@ -19,7 +19,11 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+001[48] 0+0014 0+001[8c] FDE cie=0+0000 pc=.*
DW_CFA_advance_loc: 4 to .*
DW_CFA_def_cfa: r0(.*) ofs 16
@@ -62,7 +66,11 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+009[08] 0+001c 0+002[04] FDE cie=0+007[48] pc=.*
Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)
@@ -81,12 +89,20 @@ Contents of the .eh_frame section:
Augmentation data: (0b|1b)
DW_CFA_def_cfa: r0(.*) ofs 16
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+00(c4|d0) 0+001[04] 0+001[8c] FDE cie=0+00b[08] pc=.*
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+00[de]8 0+0014 0+0000 CIE
Version: [13]
Augmentation: "zPR"
@@ -108,7 +124,11 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+01(1c|30) 0+001[8c] 0+0000 CIE
Version: [13]
Augmentation: "zPLR"
@@ -120,7 +140,11 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+01(38|50) 0+001c 0+002[04] FDE cie=0+01(1c|30) pc=.*
Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)
@@ -136,7 +160,16 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+
+#?0+0170 0+0014 0+ CIE
+#? Version: 1
+#? Augmentation: "zPR"
+#? Code alignment factor: .*
+#? Data alignment factor: .*
+#? Return address column: .*
+#? Augmentation data: 03 .. .. .. .. 1b
+#? DW_CFA_nop
+
0+01(70|88) 0+0014 0+0(01c|148|15c) FDE cie=0+0(02c|030|170) pc=.*
DW_CFA_advance_loc: 4 to .*
DW_CFA_def_cfa: r0(.*) ofs 16
@@ -150,7 +183,18 @@ Contents of the .eh_frame section:
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
-#...
+
+#?0+01b8 0+0018 0+ CIE
+#? Version: 1
+#? Augmentation: "zPLR"
+#? Code alignment factor: .*
+#? Data alignment factor: .*
+#? Return address column: .*
+#? Augmentation data: 03 .. .. .. .. 0c 1b
+#? DW_CFA_nop
+#? DW_CFA_nop
+#? DW_CFA_nop
+
0+01(a0|b8|d4) 0+001c 0+0(020|130|144) FDE cie=0+0(074|078|1b8) pc=.*
Augmentation data: (ef be ad de 00 00 00 00|00 00 00 00 de ad be ef)