aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-10-03 13:15:39 +0000
committerJakub Jelinek <jakub@redhat.com>2006-10-03 13:15:39 +0000
commitac685e6adfb9aa42b56c6348050561feed9be5fb (patch)
tree97731c5949a17e7d40fd0db02d76f9011ce2a9d5 /ld
parent00479ba8f9cd7f2ba84c6c3304987afcb4f109b8 (diff)
downloadgdb-ac685e6adfb9aa42b56c6348050561feed9be5fb.zip
gdb-ac685e6adfb9aa42b56c6348050561feed9be5fb.tar.gz
gdb-ac685e6adfb9aa42b56c6348050561feed9be5fb.tar.bz2
* elf-bfd.h (struct eh_cie_fde): Add set_loc pointer.
* elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc. Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save, DW_CFA_val_{offset{,_sf},expression}. (skip_non_nops): Record number of DW_CFA_set_loc ops. (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes all ops. If there are any DW_CFA_set_loc ops and they are pcrel or going to be pcrel, compute set_loc array. (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations against DW_CFA_set_loc operands. (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting. * ld-elf/eh4.d: New test. * ld-elf/eh4.s: New file. * ld-elf/eh4a.s: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-elf/eh4.d32
-rw-r--r--ld/testsuite/ld-elf/eh4.s92
-rw-r--r--ld/testsuite/ld-elf/eh4a.s3
4 files changed, 133 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f77f475..63770f0 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-03 Jakub Jelinek <jakub@redhat.com>
+
+ * ld-elf/eh4.d: New test.
+ * ld-elf/eh4.s: New file.
+ * ld-elf/eh4a.s: New file.
+
2006-10-02 Vladimir Prus <vladimir@codesourcery.com>
* ld-arm/use-thumb-lib.sym: Robustify, by ignoring symbols we're
diff --git a/ld/testsuite/ld-elf/eh4.d b/ld/testsuite/ld-elf/eh4.d
new file mode 100644
index 0000000..5fdd722
--- /dev/null
+++ b/ld/testsuite/ld-elf/eh4.d
@@ -0,0 +1,32 @@
+#source: eh4.s
+#source: eh4a.s
+#ld: -shared
+#readelf: -wf
+#target: x86_64-*-*
+
+The section .eh_frame contains:
+
+00000000 00000014 00000000 CIE
+ Version: 1
+ Augmentation: "zR"
+ Code alignment factor: 1
+ Data alignment factor: -8
+ Return address column: 16
+ Augmentation data: 1b
+
+ DW_CFA_def_cfa: r7 ofs 8
+ DW_CFA_offset: r16 at cfa-8
+ DW_CFA_nop
+ DW_CFA_nop
+
+00000018 00000014 0000001c FDE cie=00000000 pc=00000400..00000413
+ DW_CFA_set_loc: 00000404
+ DW_CFA_def_cfa_offset: 80
+
+00000030 00000014 00000034 FDE cie=00000000 pc=00000413..00000426
+ DW_CFA_set_loc: 00000417
+ DW_CFA_def_cfa_offset: 80
+
+00000048 ZERO terminator
+#pass
+
diff --git a/ld/testsuite/ld-elf/eh4.s b/ld/testsuite/ld-elf/eh4.s
new file mode 100644
index 0000000..2714ad6
--- /dev/null
+++ b/ld/testsuite/ld-elf/eh4.s
@@ -0,0 +1,92 @@
+ .text
+ .align 512
+ .globl foo
+ .type foo, @function
+foo:
+.LFB1:
+ subq $72, %rsp
+.LCFI1:
+ xorl %eax, %eax
+ movq %rsp, %rdi
+ call bar@PLT
+ addq $72, %rsp
+ ret
+.LFE1:
+ .size foo, .-foo
+ .globl bar
+ .type bar, @function
+bar:
+.LFB2:
+ subq $72, %rsp
+.LCFI2:
+ xorl %eax, %eax
+ movq %rsp, %rdi
+ call bar@PLT
+ addq $72, %rsp
+ ret
+.LFE2:
+ .size bar, .-bar
+ .section .eh_frame,"a",@progbits
+.Lframe1:
+ .long .LECIE1-.LSCIE1 # Length of Common Information Entry
+.LSCIE1:
+ .long 0x0 # CIE Identifier Tag
+ .byte 0x1 # CIE Version
+ .ascii "zR\0" # CIE Augmentation
+ .uleb128 0x1 # CIE Code Alignment Factor
+ .sleb128 -8 # CIE Data Alignment Factor
+ .byte 0x10 # CIE RA Column
+ .uleb128 0x1 # Augmentation size
+ .byte 0x1b # FDE Encoding (pcrel sdata4)
+ .byte 0xc # DW_CFA_def_cfa
+ .uleb128 0x7
+ .uleb128 0x8
+ .byte 0x90 # DW_CFA_offset, column 0x10
+ .uleb128 0x1
+ .align 8
+.LECIE1:
+.LSFDE1:
+ .long .LEFDE1-.LASFDE1 # FDE Length
+.LASFDE1:
+ .long .LASFDE1-.Lframe1 # FDE CIE offset
+ .long .LFB1-. # FDE initial location
+ .long .LFE1-.LFB1 # FDE address range
+ .uleb128 0x0 # Augmentation size
+ .byte 0x1 # DW_CFA_set_loc
+ .long .LCFI1-.
+ .byte 0xe # DW_CFA_def_cfa_offset
+ .uleb128 0x50
+ .align 8
+.LEFDE1:
+.Lframe2:
+ .long .LECIE2-.LSCIE2 # Length of Common Information Entry
+.LSCIE2:
+ .long 0x0 # CIE Identifier Tag
+ .byte 0x1 # CIE Version
+ .ascii "zR\0" # CIE Augmentation
+ .uleb128 0x1 # CIE Code Alignment Factor
+ .sleb128 -8 # CIE Data Alignment Factor
+ .byte 0x10 # CIE RA Column
+ .uleb128 0x1 # Augmentation size
+ .byte 0x1b # FDE Encoding (pcrel sdata4)
+ .byte 0xc # DW_CFA_def_cfa
+ .uleb128 0x7
+ .uleb128 0x8
+ .byte 0x90 # DW_CFA_offset, column 0x10
+ .uleb128 0x1
+ .align 8
+.LECIE2:
+.LSFDE2:
+ .long .LEFDE2-.LASFDE2 # FDE Length
+.LASFDE2:
+ .long .LASFDE2-.Lframe2 # FDE CIE offset
+ .long .LFB2-. # FDE initial location
+ .long .LFE2-.LFB2 # FDE address range
+ .uleb128 0x0 # Augmentation size
+ .byte 0x1 # DW_CFA_set_loc
+ .long .LCFI2-.
+ .byte 0xe # DW_CFA_def_cfa_offset
+ .uleb128 0x50
+ .align 8
+.LEFDE2:
+ .section .note.GNU-stack,"",@progbits
diff --git a/ld/testsuite/ld-elf/eh4a.s b/ld/testsuite/ld-elf/eh4a.s
new file mode 100644
index 0000000..c245871
--- /dev/null
+++ b/ld/testsuite/ld-elf/eh4a.s
@@ -0,0 +1,3 @@
+ .section .eh_frame,"a",%progbits
+ .align 8
+ .zero 8