Line 1... |
Line 1... |
/* Assembly backend for the OpenRISC 1000.
|
/* Assembly backend for the OpenRISC 1000.
|
Copyright (C) 2002, 2003, 2005, 2007, 2009
|
Copyright (C) 2002, 2003, 2005, 2007, 2009
|
|
Copyright (C) 2010 Embecosm Limited
|
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
Contributed by Damjan Lampret <lampret@opencores.org>.
|
Contributed by Damjan Lampret <lampret@opencores.org>.
|
Modified bu Johan Rydberg, <johan.rydberg@netinsight.se>.
|
Modified bu Johan Rydberg, <johan.rydberg@netinsight.se>.
|
Gyorgy Jeney <nog@sdf.lonestar.org>
|
Gyorgy Jeney <nog@sdf.lonestar.org>
|
Based upon a29k port.
|
Based upon a29k port.
|
Line 963... |
Line 964... |
/* Exactly what point is a PC-relative offset relative TO?
|
/* Exactly what point is a PC-relative offset relative TO?
|
On the 29000, they're relative to the address of the instruction,
|
On the 29000, they're relative to the address of the instruction,
|
which we have set up as the address of the fixup too. */
|
which we have set up as the address of the fixup too. */
|
|
|
long
|
long
|
md_pcrel_from (fixS *fixP)
|
md_pcrel_from_section (fixS *fixP, segT sec)
|
{
|
{
|
|
#ifndef USE_REL
|
|
if (TC_FORCE_RELOCATION (fixP)
|
|
|| (fixP->fx_addsy != (symbolS *) NULL
|
|
&& S_GET_SEGMENT (fixP->fx_addsy) != sec))
|
|
{
|
|
/* If we can't adjust this relocation, or if it references a
|
|
local symbol in a different section (which
|
|
TC_FORCE_RELOCATION can't check), let the linker figure it
|
|
out. */
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
return fixP->fx_where + fixP->fx_frag->fr_address;
|
return fixP->fx_where + fixP->fx_frag->fr_address;
|
}
|
}
|
|
|
/* Generate a reloc for a fixup. */
|
/* Generate a reloc for a fixup. */
|
|
|