/* Definitions for GCC. Part of the machine description for CRIS.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Axis Communications. Written by Hans-Peter Nilsson.
This file is part of GCC.
{
const char *name = XSTR (XEXP (DECL_RTL (funcdecl), 0), 0);
+ /* We have no other relative (to either PC or GOT) reloc than one
+ that requests a PLT entry. Since we don't set up the GOT
+ register, the jump absolutely must not be redirected through a
+ PLT entry. We manage anyway by going through a local symbol.
+ This depends on the assembler to not short-circuit equalities
+ set by the ".set" directive (at least not for PIC relocs) and
+ on the linker to direct R_CRIS_32_PLT_PCREL relocs *directly*
+ to the symbol for local symbols, instead of through a PLT
+ entry. */
name = (* targetm.strip_name_encoding) (name);
- fprintf (stream, "add.d ");
+ fprintf (stream, "\tadd.d ");
assemble_name (stream, name);
- fprintf (stream, "%s,$pc\n", CRIS_PLT_PCOFFSET_SUFFIX);
+ fprintf (stream, "..xth%s,$pc\n", CRIS_PLT_PCOFFSET_SUFFIX);
+ fprintf (stream, "\t.set ");
+ assemble_name (stream, name);
+ fprintf (stream, "..xth,");
+ assemble_name (stream, name);
+ fprintf (stream, "\n");
}
else
{