+2004-04-01 Asgari Jinia <asgarij@kpitcummins.com>
+ Dhananjay Deshpande <dhananjayd@kpitcummins.com>
+
+ * config/tc-sh.c (dont_adjust_reloc_32): New variable.
+ (sh_fix_adjustable): Avoid adjusting BFD_RELOC_32 when
+ dont_adjust_reloc_32 is set.
+ (md_longopts): Add option -renesas.
+ (md_parse_option, md_show_usage): Likewise.
+ * doc/c-sh.texi: Likewise.
+
2004-04-01 Dave Korn <dk@artimi.com>
* config/tc-dlx.c (md_assemble): set fx_no_overflow flag for
int sh_small;
+/* Flag to generate relocations against symbol values for local symbols. */
+
+static int dont_adjust_reloc_32;
+
/* preset architecture set, if given; zero otherwise. */
static int preset_target_arch;
#define OPTION_SMALL (OPTION_LITTLE + 1)
#define OPTION_DSP (OPTION_SMALL + 1)
#define OPTION_ISA (OPTION_DSP + 1)
+#define OPTION_RENESAS (OPTION_ISA + 1)
{"relax", no_argument, NULL, OPTION_RELAX},
{"big", no_argument, NULL, OPTION_BIG},
{"small", no_argument, NULL, OPTION_SMALL},
{"dsp", no_argument, NULL, OPTION_DSP},
{"isa", required_argument, NULL, OPTION_ISA},
+ {"renesas", no_argument, NULL, OPTION_RENESAS},
+
#ifdef HAVE_SH64
-#define OPTION_ABI (OPTION_ISA + 1)
+#define OPTION_ABI (OPTION_RENESAS + 1)
#define OPTION_NO_MIX (OPTION_ABI + 1)
#define OPTION_SHCOMPACT_CONST_CRANGE (OPTION_NO_MIX + 1)
#define OPTION_NO_EXPAND (OPTION_SHCOMPACT_CONST_CRANGE + 1)
preset_target_arch = arch_sh1_up & ~arch_sh2e_up;
break;
+ case OPTION_RENESAS:
+ dont_adjust_reloc_32 = 1;
+ break;
+
case OPTION_ISA:
if (strcasecmp (arg, "sh4") == 0)
preset_target_arch = arch_sh4;
-little generate little endian code\n\
-big generate big endian code\n\
-relax alter jump instructions for long displacements\n\
+-renesas disable optimization with section symbol for\n\
+ compatibility with Renesas assembler.\n\
-small align sections to 4 byte boundaries, not 16\n\
-dsp enable sh-dsp insns, and disable floating-point ISAs.\n\
-isa=[sh4\n\
if (fixP->fx_r_type == BFD_RELOC_32_PLT_PCREL
|| fixP->fx_r_type == BFD_RELOC_32_GOT_PCREL
|| fixP->fx_r_type == BFD_RELOC_SH_GOTPC
+ || ((fixP->fx_r_type == BFD_RELOC_32) && dont_adjust_reloc_32)
|| fixP->fx_r_type == BFD_RELOC_RVA)
return 0;