emitting ELF object.
(md_show_usage): Only mention --pic if the assembler can generate
ELF objects.
* doc/c-cris.texi (CRIS-Opt): Mention that generating ELF is a
prerequisite for --pic being a valid option.
+
+ * config/tc-cris.c (md_parse_option) <OPTION_PIC>: Error if not
+ emitting ELF object.
+ (md_show_usage): Only mention --pic if the assembler can generate
+ ELF objects.
+ * doc/c-cris.texi (CRIS-Opt): Mention that generating ELF is a
+ prerequisite for --pic being a valid option.
+
PR gas/12755
break;
case OPTION_PIC:
+ if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
+ as_bad (_("--pic is invalid for this object format"));
pic = TRUE;
if (cris_arch != arch_crisv32)
md_long_jump_size = cris_any_v0_v10_long_jump_size_pic;
_(" --no-underscore User symbols do not have any prefix.\n"));
fprintf (stream, "%s",
_(" Registers will require a `$'-prefix.\n"));
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
fprintf (stream, "%s",
_(" --pic Enable generation of position-independent code.\n"));
+#endif
fprintf (stream, "%s",
_(" --march=<arch> Generate code for <arch>. Valid choices for <arch>\n\
are v0_v10, v10, v32 and common_v10_v32.\n"));
position-independent-code (@pxref{crispic}). This will also
affect expansion of instructions. The expansion with
@option{--pic} will use PC-relative rather than (slightly
-faster) absolute addresses in those expansions.
+faster) absolute addresses in those expansions. This option is only
+valid when generating ELF format object files.
@cindex @option{--march=@var{architecture}} command line option, CRIS
@cindex CRIS @option{--march=@var{architecture}} command line option