From d7de64088c7ce0d642c73feb66f408c601cffb0d Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 31 Aug 2017 03:53:44 -0700 Subject: [PATCH] Add a test for PR ld/22048 PR ld/22048 * testsuite/ld-x86-64/pr22048.d: New file. * testsuite/ld-x86-64/pr22048a.s: Likewise. * testsuite/ld-x86-64/pr22048b.s: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr22048. --- ld/ChangeLog | 8 ++++++++ ld/testsuite/ld-x86-64/pr22048.d | 25 +++++++++++++++++++++++++ ld/testsuite/ld-x86-64/pr22048a.s | 4 ++++ ld/testsuite/ld-x86-64/pr22048b.s | 8 ++++++++ ld/testsuite/ld-x86-64/x86-64.exp | 1 + 5 files changed, 46 insertions(+) create mode 100644 ld/testsuite/ld-x86-64/pr22048.d create mode 100644 ld/testsuite/ld-x86-64/pr22048a.s create mode 100644 ld/testsuite/ld-x86-64/pr22048b.s diff --git a/ld/ChangeLog b/ld/ChangeLog index 670f3562eb3..418fbb05409 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,11 @@ +2017-08-31 H.J. Lu + + PR ld/22048 + * testsuite/ld-x86-64/pr22048.d: New file. + * testsuite/ld-x86-64/pr22048a.s: Likewise. + * testsuite/ld-x86-64/pr22048b.s: Likewise. + * testsuite/ld-x86-64/x86-64.exp: Run pr22048. + 2017-08-31 Alan Modra * testsuite/ld-elf/eh3.d: Update. diff --git a/ld/testsuite/ld-x86-64/pr22048.d b/ld/testsuite/ld-x86-64/pr22048.d new file mode 100644 index 00000000000..063d305c4d4 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048.d @@ -0,0 +1,25 @@ +#source: pr22048a.s +#source: pr22048b.s +#as: --64 +#ld: -melf_x86_64 -Ttext 0x400078 +#readelf: -wf + +Contents of the .eh_frame section: + +0+0000 0+014 0+0000 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 \(rsp\) ofs 8 + DW_CFA_offset: r16 \(rip\) at cfa-8 + DW_CFA_nop + DW_CFA_nop + +0+0018 0+0010 0+001c FDE cie=0+0000 pc=0+400078\.\.0+40007a + DW_CFA_nop + DW_CFA_nop + DW_CFA_nop diff --git a/ld/testsuite/ld-x86-64/pr22048a.s b/ld/testsuite/ld-x86-64/pr22048a.s new file mode 100644 index 00000000000..060bd0171c0 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048a.s @@ -0,0 +1,4 @@ + .section .eh_frame,"a",@progbits + .align 4 + .zero 4 + .ident "GCC" diff --git a/ld/testsuite/ld-x86-64/pr22048b.s b/ld/testsuite/ld-x86-64/pr22048b.s new file mode 100644 index 00000000000..eae67522558 --- /dev/null +++ b/ld/testsuite/ld-x86-64/pr22048b.s @@ -0,0 +1,8 @@ + .text + .globl _start + .type _start, @function +_start: + .cfi_startproc + rep ret + .cfi_endproc + .size _start, .-_start diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index 0e018c55773..bf73534c1b8 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -570,6 +570,7 @@ run_dump_test "pr20253-4f" run_dump_test "pr20253-5a" run_dump_test "pr20253-5b" run_dump_test "tlsdesc2" +run_dump_test "pr22048" proc undefined_weak {cflags ldflags} { set testname "Undefined weak symbol" -- 2.30.2