diff options
author | Adam Nemet <anemet@caviumnetworks.com> | 2009-09-19 20:23:55 +0000 |
---|---|---|
committer | Adam Nemet <nemet@gcc.gnu.org> | 2009-09-19 20:23:55 +0000 |
commit | b53da24424c79a824fa74ec3160efe0bbe9627eb (patch) | |
tree | b83b530090d1d703cf6e9697e8b8bb94870ed94a /gcc/configure | |
parent | 4172245c93c6b19cf73fec9c119af87a9df63656 (diff) | |
download | gcc-b53da24424c79a824fa74ec3160efe0bbe9627eb.zip gcc-b53da24424c79a824fa74ec3160efe0bbe9627eb.tar.gz gcc-b53da24424c79a824fa74ec3160efe0bbe9627eb.tar.bz2 |
mips.opt (mrelax-pic-calls): New option.
* config/mips/mips.opt (mrelax-pic-calls): New option.
* config/mips/mips.c (mips_strip_unspec_address): Move it up in
the file.
(mips_unspec_call): Change "unspec_call" expander into this.
(mips_strip_unspec_call): New function.
(mips_got_load): Call mips_unspec_call instead of
gen_unspec_call<mode>.
(mips16_build_call_stub): Fix comment for fp_code. Adjust call to
MIPS_CALL.
(mips_cfg_in_reorg): New function.
(mips16_lay_out_constants): Use it to decide whether to call
CFG-aware insn splitting.
(r10k_insert_cache_barriers): Move CFG set-up code from here to
mips_reorg. Move DF set-up code from here ...
(mips_df_reorg): ... to here. Call r10k_insert_cache_barriers
from here.
(mips_reorg): Call mips_df_reorg instead of
r10k_insert_cache_barriers. Move CFG set-up code here from
r10k_insert_cache_barriers.
(mips_call_expr_from_insn): New function.
(mips_pic_call_symbol_from_set): Likewise.
(mips_find_pic_call_symbol): Likewise.
(mips_annotate_pic_call_expr): Likewise.
(mips_get_pic_call_symbol): Likewise.
(mips_annotate_pic_calls): Likewise.
(mips_override_options): Disable -mrelax-pic-calls unless PIC
calls are used.
(mips_set_mips16_mode): Disable -mrelax-pic-calls for MIPS16.
* config/mips/mips-protos.h (mips_get_pic_call_symbol): Declare it.
* config/mips/mips.h (MIPS_CALL): Use it to print the .reloc
directive.
* config/mips/mips.md (UNSPEC_CALL_ATTR): New unspec.
(unspec_call<mode>): Remove it.
(sibcall_internal, sibcall_value_internal,
sibcall_value_multiple_internal, call_internal, call_split,
call_value_internal, call_value_split,
call_value_multiple_internal, call_value_multiple_split): Pass
SIZE_OPNO to MIPS_CALL.
(call_internal_direct, call_direct_split,
call_value_internal_direct, call_value_direct_split): Pass -1 as
SIZE_OPNO to MIPS_CALL.
* configure.ac <mips*-*-*>: Add test for .reloc R_MIPS_JALR.
* configure: Regenerate.
* doc/invoke.texi (Option Summary): Add -mrelax-pic-calls
and -mno-relax-pic-calls.
(MIPS Options): Document -mrelax-pic-calls
and -mno-relax-pic-calls.
testsuite/
* gcc.target/mips/mips.exp: Add relax-pic-calls
under -mfoo/-mno-foo options.
(mips-dg-options): Make -mrelax-pic-calls imply -mno-plt, -mabicalls
and -mexplicit-relocs.
* gcc.target/mips/call-1.c: New test.
* gcc.target/mips/call-2.c: New test.
* gcc.target/mips/call-3.c: New test.
* gcc.target/mips/lazy-binding-1.c: Add MIPS-specific dg-options.
* gcc.dg/tree-ssa/loop-1.c: Likewise.
From-SVN: r151890
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/configure b/gcc/configure index 2e9385e..2369ba7 100755 --- a/gcc/configure +++ b/gcc/configure @@ -23687,6 +23687,44 @@ if test $gcc_cv_as_mips_dtprelword = yes; then $as_echo "#define HAVE_AS_DTPRELWORD 1" >>confdefs.h fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker for explicit JALR relocation" >&5 +$as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6; } + gcc_cv_as_ld_jalr_reloc=no + if test $gcc_cv_as_mips_explicit_relocs = yes; then + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 20 -o "$gcc_cv_gld_major_version" -gt 2 \ + && test $in_tree_ld_is_elf = yes; then + gcc_cv_as_ld_jalr_reloc=yes + fi + elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x; then + echo ' .ent x' > conftest.s + echo 'x: ld $2,%got_disp(y)($3)' >> conftest.s + echo ' ld $25,%call16(y)($28)' >> conftest.s + echo ' .reloc 1f,R_MIPS_JALR,y' >> conftest.s + echo '1: jalr $25' >> conftest.s + echo ' .reloc 1f,R_MIPS_JALR,x' >> conftest.s + echo '1: jalr $25' >> conftest.s + echo ' .end x' >> conftest.s + if $gcc_cv_as -o conftest.o conftest.s >/dev/null 2>&5 \ + && $gcc_cv_ld -shared -o conftest.so conftest.o >/dev/null 2>&5; then + if $gcc_cv_objdump -d conftest.so | grep -q jalr \ + && $gcc_cv_objdump -d conftest.so | grep -q "bal.*<x>"; then + gcc_cv_as_ld_jalr_reloc=yes + fi + fi + rm -f conftest.* + fi + fi + if test $gcc_cv_as_ld_jalr_reloc = yes; then + if test x$target_cpu_default = x; then + target_cpu_default=MASK_RELAX_PIC_CALLS + else + target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5 +$as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; } ;; esac |