From: Catherine Moore Date: Thu, 29 Oct 2015 13:58:16 +0000 (-0700) Subject: 2015-10-29 Catherine Moore X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ca9584fb9b4a54232d2538de9f75b1916bda00fe;p=binutils-gdb.git 2015-10-29 Catherine Moore bfd/ * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output section to bfd_abs_section_ptr if the stub is discarded. ld/testsuite/ * ld-mips-elf/mips16-fp-stub-1.s: New. * ld-mips-elf/mips16-fp-stub-2.s: New. * ld-mips-elf/mips16-fp-stub.d: New. * ld-mips-elf/mips-elf.exp: Run new tests. * ld-mips-elf/mips16-intermix.d: Update expected output. https://sourceware.org/ml/binutils/2015-10/msg00137.html --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 41cfcbe2342..593848148d2 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2015-10-29 Catherine Moore + + * elfxx-mips.c (mips_elf_check_mips16_stubs): Set a stub's output + section to bfd_abs_section_ptr if the stub is discarded. + 2015-10-29 Ed Schouten * config.bfd (targ_defvec): Add support for CloudABI on aarch64. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 12d7a03d631..57e1b6d9cf5 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -1707,6 +1707,7 @@ mips_elf_check_mips16_stubs (struct bfd_link_info *info, h->fn_stub->flags &= ~SEC_RELOC; h->fn_stub->reloc_count = 0; h->fn_stub->flags |= SEC_EXCLUDE; + h->fn_stub->output_section = bfd_abs_section_ptr; } if (h->call_stub != NULL @@ -1719,6 +1720,7 @@ mips_elf_check_mips16_stubs (struct bfd_link_info *info, h->call_stub->flags &= ~SEC_RELOC; h->call_stub->reloc_count = 0; h->call_stub->flags |= SEC_EXCLUDE; + h->call_stub->output_section = bfd_abs_section_ptr; } if (h->call_fp_stub != NULL @@ -1731,6 +1733,7 @@ mips_elf_check_mips16_stubs (struct bfd_link_info *info, h->call_fp_stub->flags &= ~SEC_RELOC; h->call_fp_stub->reloc_count = 0; h->call_fp_stub->flags |= SEC_EXCLUDE; + h->call_fp_stub->output_section = bfd_abs_section_ptr; } } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index f0124f999fa..d775f114291 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2015-10-29 Catherine Moore + + * ld-mips-elf/mips16-fp-stub-1.s: New. + * ld-mips-elf/mips16-fp-stub-2.s: New. + * ld-mips-elf/mips16-fp-stub.d: New. + * ld-mips-elf/mips-elf.exp: Run new tests. + * ld-mips-elf/mips16-intermix.d: Update expected output. + 2015-10-28 H.J. Lu PR ld/19162 diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index dd8b2288623..3b02bc0e245 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -666,6 +666,16 @@ run_ld_link_tests $mips16_intermix_test run_dump_test "mips16-local-stubs-1" +set mips16_fp_stub_test [list \ + [list "Floating-point stub for mips16 functions" \ + "$abi_ldflags(o32)" "" \ + "$abi_asflags(o32) -mips32r2" \ + {mips16-fp-stub-1.s mips16-fp-stub-2.s} \ + {{readelf --debug-dump=frames mips16-fp-stub.d}} \ + "mips16-fp-stub"]] + +run_ld_link_tests $mips16_fp_stub_test + set o32flagslist [list [list as $abi_asflags(o32)] [list ld $abi_ldflags(o32)]] foreach firstfpabi [list 0 1 2 3 4 5 6 7 ] { diff --git a/ld/testsuite/ld-mips-elf/mips16-fp-stub-1.s b/ld/testsuite/ld-mips-elf/mips16-fp-stub-1.s new file mode 100644 index 00000000000..98a5067b112 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-fp-stub-1.s @@ -0,0 +1,58 @@ + .file 1 "mips-fp-stub-1.c" + .section .mdebug.abi32 + .previous + .nan legacy + .module fp=32 + .module oddspreg + # Stub function to call float foo (float, float) + .section .mips16.call.fp.foo,"ax",@progbits + .align 2 + .set nomips16 + .set nomicromips + .ent __call_stub_fp_foo + .type __call_stub_fp_foo, @function +__call_stub_fp_foo: + .cfi_startproc + .cfi_def_cfa 29,-4 + .cfi_escape 0x16,29,1,0x6d + move $18,$31 + mtc1 $4,$f12 + mtc1 $5,$f14 + jal foo + .cfi_register 31,18 + mfc1 $2,$f0 + jr $18 + .cfi_endproc + .size __call_stub_fp_foo, .-__call_stub_fp_foo + .end __call_stub_fp_foo + .text + .align 2 + .globl main + .set mips16 + .set nomicromips + .ent main + .type main, @function +main: + .frame $17,24,$31 # vars= 8, regs= 3/0, args= 16, gp= 0 + .mask 0x80060000,-4 + .fmask 0x00000000,0 + save 40,$17,$18,$31 + addiu $17,$sp,16 + lw $3,.L3 + lw $2,.L4 + move $5,$3 + move $4,$2 + jal foo + sw $2,0($17) + li $2,0 + move $sp,$17 + restore 24,$17,$18,$31 + j $31 + .align 2 +.L3: + .word 1085485875 +.L4: + .word 1065353216 + .end main + .size main, .-main + .ident "GCC: (Sourcery CodeBench Lite 2015.11-12 - Preview) 5.2.0" diff --git a/ld/testsuite/ld-mips-elf/mips16-fp-stub-2.s b/ld/testsuite/ld-mips-elf/mips16-fp-stub-2.s new file mode 100644 index 00000000000..d63cc7c7d7f --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-fp-stub-2.s @@ -0,0 +1,43 @@ + .file 1 "mips-fp-stub-2.c" + .section .mdebug.abi32 + .previous + .nan legacy + .module fp=32 + .module oddspreg + .text + .align 2 + .globl foo + # Stub function for foo (float, float) + .section .mips16.fn.foo,"ax",@progbits + .align 2 + .set nomips16 + .set nomicromips + .ent __fn_stub_foo + .type __fn_stub_foo, @function +__fn_stub_foo: + la $25,foo + mfc1 $4,$f12 + mfc1 $5,$f14 + jr $25 + .end __fn_stub_foo + __fn_local_foo = foo + .text + .set mips16 + .set nomicromips + .ent foo + .type foo, @function +foo: + .frame $17,8,$31 # vars= 0, regs= 2/0, args= 0, gp= 0 + .mask 0x80020000,-4 + .fmask 0x00000000,0 + save 8,$17,$31 + move $17,$sp + sw $4,8($17) + sw $5,12($17) + lw $2,8($17) + move $sp,$17 + restore 8,$17,$31 + j $31 + .end foo + .size foo, .-foo + .ident "GCC: (Sourcery CodeBench Lite 2015.11-12 - Preview) 5.2.0" diff --git a/ld/testsuite/ld-mips-elf/mips16-fp-stub.d b/ld/testsuite/ld-mips-elf/mips16-fp-stub.d new file mode 100644 index 00000000000..1d4aa288664 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/mips16-fp-stub.d @@ -0,0 +1,2 @@ + +Section '\.eh_frame' has no debugging data\. diff --git a/ld/testsuite/ld-mips-elf/mips16-intermix.d b/ld/testsuite/ld-mips-elf/mips16-intermix.d index 10c72706324..9318e3b9414 100644 --- a/ld/testsuite/ld-mips-elf/mips16-intermix.d +++ b/ld/testsuite/ld-mips-elf/mips16-intermix.d @@ -60,9 +60,6 @@ SYMBOL TABLE: .* l F .text 0+[0-9a-f]+ 0xf0 m16_static32_d_l .* l F .text 0+[0-9a-f]+ m32_static16_d_l .* l F .text 0+[0-9a-f]+ 0xf0 m16_static16_d_l -# ??? We aren't yet able to get rid of the symbol table entry for -# __fn_stub_m16_d_d, or its .pdr entry. -.* l F .text 0+[0-9a-f]+ * .* l F .text 0+[0-9a-f]+ m32_static_d_d .* l F .text 0+[0-9a-f]+ 0xf0 m16_static_d_d .* l F .text 0+[0-9a-f]+ m32_static1_d_d @@ -94,6 +91,9 @@ SYMBOL TABLE: .* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_l .* l F .text 0+[0-9a-f]+ __call_stub_fp_m32_static16_d_d .* l F .text 0+[0-9a-f]+ __call_stub_fp_m16_static16_d_d +# ??? We aren't yet able to get rid of the symbol table entry for +# __fn_stub_m16_d_d, or its .pdr entry. +.* l df \*ABS\* 0+[0-9a-f]+ * #... .* g F .text 0+[0-9a-f]+ m32_ld #...