Commit 98e8dd4d by Chung-Lin Tang Committed by Chung-Lin Tang

nios2.md (unspec): Remove UNSPEC_TLS, UNSPEC_TLS_LDM.

2014-04-01  Chung-Lin Tang  <cltang@codesourcery.com>

	* config/nios2/nios2.md (unspec): Remove UNSPEC_TLS, UNSPEC_TLS_LDM.
	* config/nios2/nios2.c (nios2_function_profiler): Fix addi operand
	typo.
	(nios2_large_got_address): Remove unneeded 'sym' parameter.
	(nios2_got_address): Update nios2_large_got_address call site.
	(nios2_delegitimize_address): New function.
	(TARGET_DELEGITIMIZE_ADDRESS): Define to nios2_delegitimize_address.
	* config/nios2/linux.h (GLIBC_DYNAMIC_LINKER): Define.
	(LINK_SPEC): Specify dynamic linker using GNU_USER_DYNAMIC_LINKER.

From-SVN: r208988
parent 8785c60a
2014-04-01 Chung-Lin Tang <cltang@codesourcery.com>
* config/nios2/nios2.md (unspec): Remove UNSPEC_TLS, UNSPEC_TLS_LDM.
* config/nios2/nios2.c (nios2_function_profiler): Fix addi operand
typo.
(nios2_large_got_address): Remove unneeded 'sym' parameter.
(nios2_got_address): Update nios2_large_got_address call site.
(nios2_delegitimize_address): New function.
(TARGET_DELEGITIMIZE_ADDRESS): Define to nios2_delegitimize_address.
* config/nios2/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Specify dynamic linker using GNU_USER_DYNAMIC_LINKER.
2014-04-01 Martin Husemann <martin@duskware.de> 2014-04-01 Martin Husemann <martin@duskware.de>
* config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define __mips_o32 * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Define __mips_o32
......
...@@ -26,11 +26,16 @@ ...@@ -26,11 +26,16 @@
} \ } \
while (0) while (0)
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
#undef LINK_SPEC #undef LINK_SPEC
#define LINK_SPEC LINK_SPEC_ENDIAN \ #define LINK_SPEC LINK_SPEC_ENDIAN \
" %{shared:-shared} \ "%{shared:-shared} \
%{static:-Bstatic} \ %{!shared: \
%{rdynamic:-export-dynamic}" %{!static: \
%{rdynamic:-export-dynamic} \
-dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
%{static:-static}}"
/* This toolchain implements the ABI for Linux Systems documented in the /* This toolchain implements the ABI for Linux Systems documented in the
Nios II Processor Reference Handbook. */ Nios II Processor Reference Handbook. */
......
...@@ -695,7 +695,7 @@ nios2_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) ...@@ -695,7 +695,7 @@ nios2_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
fprintf (file, "\taddi\tr3, r3, %%lo(_gp_got - 1b)\n"); fprintf (file, "\taddi\tr3, r3, %%lo(_gp_got - 1b)\n");
fprintf (file, "\tadd\tr2, r2, r3\n"); fprintf (file, "\tadd\tr2, r2, r3\n");
fprintf (file, "\tmovhi\tr3, %%call_hiadj(_mcount)\n"); fprintf (file, "\tmovhi\tr3, %%call_hiadj(_mcount)\n");
fprintf (file, "\taddi\tr3, %%call_lo(_mcount)\n"); fprintf (file, "\taddi\tr3, r3, %%call_lo(_mcount)\n");
fprintf (file, "\tadd\tr3, r2, r3\n"); fprintf (file, "\tadd\tr3, r2, r3\n");
fprintf (file, "\tldw\tr2, 0(r3)\n"); fprintf (file, "\tldw\tr2, 0(r3)\n");
fprintf (file, "\tcallr\tr2\n"); fprintf (file, "\tcallr\tr2\n");
...@@ -1183,7 +1183,7 @@ nios2_unspec_offset (rtx loc, int unspec) ...@@ -1183,7 +1183,7 @@ nios2_unspec_offset (rtx loc, int unspec)
/* Generate GOT pointer based address with large offset. */ /* Generate GOT pointer based address with large offset. */
static rtx static rtx
nios2_large_got_address (rtx sym, rtx offset) nios2_large_got_address (rtx offset)
{ {
rtx addr = gen_reg_rtx (Pmode); rtx addr = gen_reg_rtx (Pmode);
emit_insn (gen_add3_insn (addr, pic_offset_table_rtx, emit_insn (gen_add3_insn (addr, pic_offset_table_rtx,
...@@ -1199,7 +1199,7 @@ nios2_got_address (rtx loc, int unspec) ...@@ -1199,7 +1199,7 @@ nios2_got_address (rtx loc, int unspec)
crtl->uses_pic_offset_table = 1; crtl->uses_pic_offset_table = 1;
if (nios2_large_offset_p (unspec)) if (nios2_large_offset_p (unspec))
return nios2_large_got_address (loc, offset); return nios2_large_got_address (offset);
return gen_rtx_PLUS (Pmode, pic_offset_table_rtx, offset); return gen_rtx_PLUS (Pmode, pic_offset_table_rtx, offset);
} }
...@@ -1805,6 +1805,30 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, ...@@ -1805,6 +1805,30 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return x; return x;
} }
static rtx
nios2_delegitimize_address (rtx x)
{
x = delegitimize_mem_from_attrs (x);
if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == UNSPEC)
{
switch (XINT (XEXP (x, 0), 1))
{
case UNSPEC_PIC_SYM:
case UNSPEC_PIC_CALL_SYM:
case UNSPEC_PIC_GOTOFF_SYM:
case UNSPEC_ADD_TLS_GD:
case UNSPEC_ADD_TLS_LDM:
case UNSPEC_LOAD_TLS_IE:
case UNSPEC_ADD_TLS_LE:
x = XVECEXP (XEXP (x, 0), 0, 0);
gcc_assert (GET_CODE (x) == SYMBOL_REF);
break;
}
}
return x;
}
/* Main expander function for RTL moves. */ /* Main expander function for RTL moves. */
int int
nios2_emit_move_sequence (rtx *operands, enum machine_mode mode) nios2_emit_move_sequence (rtx *operands, enum machine_mode mode)
...@@ -3259,6 +3283,9 @@ nios2_merge_decl_attributes (tree olddecl, tree newdecl) ...@@ -3259,6 +3283,9 @@ nios2_merge_decl_attributes (tree olddecl, tree newdecl)
#undef TARGET_LEGITIMIZE_ADDRESS #undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS nios2_legitimize_address #define TARGET_LEGITIMIZE_ADDRESS nios2_legitimize_address
#undef TARGET_DELEGITIMIZE_ADDRESS
#define TARGET_DELEGITIMIZE_ADDRESS nios2_delegitimize_address
#undef TARGET_LEGITIMATE_ADDRESS_P #undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P nios2_legitimate_address_p #define TARGET_LEGITIMATE_ADDRESS_P nios2_legitimate_address_p
......
...@@ -74,8 +74,6 @@ ...@@ -74,8 +74,6 @@
UNSPEC_PIC_SYM UNSPEC_PIC_SYM
UNSPEC_PIC_CALL_SYM UNSPEC_PIC_CALL_SYM
UNSPEC_PIC_GOTOFF_SYM UNSPEC_PIC_GOTOFF_SYM
UNSPEC_TLS
UNSPEC_TLS_LDM
UNSPEC_LOAD_TLS_IE UNSPEC_LOAD_TLS_IE
UNSPEC_ADD_TLS_LE UNSPEC_ADD_TLS_LE
UNSPEC_ADD_TLS_GD UNSPEC_ADD_TLS_GD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment