gas: constify md_{short,long}opts and md_longopts_size

First of all make the declarations globally visible, such that producer
and consumer actually share them.

For the latter two simply add const (as PPC already had it,), while for
the former achieve the effect by converting to an array: There's no need
for the extra level of indirection.
This commit is contained in:
Jan Beulich 2024-10-29 08:08:02 +01:00
parent a8ff55b5b4
commit 641cf0e2c0
78 changed files with 232 additions and 237 deletions

View File

@ -438,7 +438,6 @@ parse_args (int * pargc, char *** pargv)
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1. */
char *shortopts;
extern const char *md_shortopts;
static const char std_shortopts[] =
{
'-', 'J',
@ -455,8 +454,6 @@ parse_args (int * pargc, char *** pargv)
'\0'
};
struct option *longopts;
extern struct option md_longopts[];
extern size_t md_longopts_size;
/* Codes used for the long options with no short synonyms. */
enum option_values
{

View File

@ -10467,7 +10467,7 @@ md_begin (void)
/* Command line processing. */
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
#ifdef AARCH64_BI_ENDIAN
#define OPTION_EB (OPTION_MD_BASE + 0)
@ -10480,7 +10480,7 @@ const char *md_shortopts = "m:";
#endif
#endif
struct option md_longopts[] = {
const struct option md_longopts[] = {
#ifdef OPTION_EB
{"EB", no_argument, NULL, OPTION_EB},
#endif
@ -10490,7 +10490,7 @@ struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct aarch64_option_table
{

View File

@ -243,12 +243,12 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "rRsSfFdDxXpP";
#ifdef OBJ_EVAX
const char *md_shortopts = "Fm:g+1h:HG:";
const char md_shortopts[] = "Fm:g+1h:HG:";
#else
const char *md_shortopts = "Fm:gG:";
const char md_shortopts[] = "Fm:gG:";
#endif
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_32ADDR (OPTION_MD_BASE)
{ "32addr", no_argument, NULL, OPTION_32ADDR },
@ -269,7 +269,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
#ifdef OBJ_EVAX
#define AXP_REG_R0 0

View File

@ -183,7 +183,7 @@ const pseudo_typeS md_pseudo_table[] =
{ NULL, NULL, 0 }
};
const char *md_shortopts = "";
const char md_shortopts[] = "";
enum options
{
@ -229,7 +229,7 @@ enum options
OPTION_RTSC
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "EB", no_argument, NULL, OPTION_EB },
{ "EL", no_argument, NULL, OPTION_EL },
@ -292,7 +292,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Local data and data types. */

View File

@ -30341,7 +30341,7 @@ md_begin (void)
*/
const char * md_shortopts = "m:k";
const char md_shortopts[] = "m:k";
#ifdef ARM_BI_ENDIAN
#define OPTION_EB (OPTION_MD_BASE + 0)
@ -30356,7 +30356,7 @@ const char * md_shortopts = "m:k";
#define OPTION_FIX_V4BX (OPTION_MD_BASE + 2)
#define OPTION_FDPIC (OPTION_MD_BASE + 3)
struct option md_longopts[] =
const struct option md_longopts[] =
{
#ifdef OPTION_EB
{"EB", no_argument, NULL, OPTION_EB},
@ -30371,7 +30371,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct arm_option_table
{

View File

@ -161,7 +161,7 @@ const char line_comment_chars[] = "#";
const char *avr_line_separator_chars = "$";
static const char *avr_line_separator_chars_no_dollar = "";
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct mcu_type_s
{
const char *name;
@ -571,7 +571,7 @@ enum options
OPTION_NO_DOLLAR_LINE_SEPARATOR,
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mmcu", required_argument, NULL, OPTION_MMCU },
{ "mall-opcodes", no_argument, NULL, OPTION_ALL_OPCODES },
@ -585,7 +585,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Display nicely formatted list of known MCU names. */

View File

@ -314,13 +314,13 @@ struct bfin_cpu bfin_cpus[] =
};
/* Define bfin-specific command-line options (there are none). */
const char *md_shortopts = "";
const char md_shortopts[] = "";
#define OPTION_FDPIC (OPTION_MD_BASE)
#define OPTION_NOPIC (OPTION_MD_BASE + 1)
#define OPTION_MCPU (OPTION_MD_BASE + 2)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mcpu", required_argument, NULL, OPTION_MCPU },
{ "mfdpic", no_argument, NULL, OPTION_FDPIC },
@ -329,7 +329,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int

View File

@ -126,7 +126,7 @@ enum options
OPTION_NO_RELAX,
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "EL", no_argument, NULL, OPTION_LITTLE_ENDIAN },
{ "EB", no_argument, NULL, OPTION_BIG_ENDIAN },
@ -137,9 +137,9 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
const char md_shortopts[] = "";
/* BPF supports little-endian and big-endian variants. The following
global records what endianness to use. It can be configured using

View File

@ -109,12 +109,12 @@ symbolS * GOT_symbol;
#endif
/* Target-specific multicharacter options, not const-declared at usage. */
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static void
l_cons (int nbytes)

View File

@ -414,7 +414,7 @@ const relax_typeS md_cris_relax_table[] =
#undef BDAP_WB
/* Target-specific multicharacter options, not const-declared. */
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_NO_US (OPTION_MD_BASE + 0)
{"no-underscore", no_argument, NULL, OPTION_NO_US},
@ -432,8 +432,8 @@ struct option md_longopts[] =
};
/* Not const-declared. */
size_t md_longopts_size = sizeof (md_longopts);
const char *md_shortopts = "hHN";
const size_t md_longopts_size = sizeof (md_longopts);
const char md_shortopts[] = "hHN";
/* At first glance, this may seems wrong and should be 4 (ba + nop); but
since a short_jump must skip a *number* of long jumps, it must also be

View File

@ -44,10 +44,6 @@ extern unsigned int cris_mach (void);
#define TARGET_BYTES_BIG_ENDIAN 0
extern const char *md_shortopts;
extern struct option md_longopts[];
extern size_t md_longopts_size;
extern const pseudo_typeS md_pseudo_table[];
/* This should be optional, since it is ignored as an escape (assumed to

View File

@ -102,12 +102,12 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "f'";
/* Target-specific multicharacter options, not const-declared at usage. */
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* This table describes all the machine specific pseudo-ops
the assembler has to support. The fields are:

View File

@ -967,9 +967,9 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "rRsSfFdDxXeEpP";
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] = {
const struct option md_longopts[] = {
#define OPTION_MARCH (OPTION_MD_BASE + 0)
{"march", required_argument, NULL, OPTION_MARCH},
#define OPTION_MCPU (OPTION_MD_BASE + 1)
@ -1023,7 +1023,7 @@ struct option md_longopts[] = {
{"mvdsp", no_argument, &do_opt_mvdsp, CSKY_ISA_VDSP},
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static struct csky_insn_info csky_insn;

View File

@ -28,7 +28,7 @@
const char comment_chars[] = ";";
const char line_comment_chars[] = "#";
const char line_separator_chars[] = "";
const char *md_shortopts = "O";
const char md_shortopts[] = "O";
const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
@ -88,7 +88,7 @@ enum options
OPTION_NOGSTABSPACKING
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"nowarnswap", no_argument, NULL, OPTION_NOWARNSWAP},
{"gstabspacking", no_argument, NULL, OPTION_GSTABSPACKING},
@ -98,7 +98,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Opcode hash table. */
static htab_t d10v_hash;

View File

@ -27,7 +27,7 @@
const char comment_chars[] = ";";
const char line_comment_chars[] = "#";
const char line_separator_chars[] = "";
const char *md_shortopts = "OnNcC";
const char md_shortopts[] = "OnNcC";
const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
@ -107,12 +107,12 @@ static symbolS *d30v_last_label;
#define NOP_RIGHT ((long long) NOP)
#define NOP2 (FM00 | NOP_LEFT | NOP_RIGHT)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Opcode hash table. */
static htab_t d30v_hash;

View File

@ -1047,14 +1047,14 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
fixP->fx_no_overflow = 1;
}
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,

View File

@ -103,16 +103,16 @@ enum options
OPTION_CPU_EPIPHANY16
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mepiphany ", no_argument, NULL, OPTION_CPU_EPIPHANY },
{ "mepiphany16", no_argument, NULL, OPTION_CPU_EPIPHANY16 },
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
const char md_shortopts[] = "";
int
md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)

View File

@ -55,13 +55,13 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
#define FR30_SHORTOPTS ""
const char * md_shortopts = FR30_SHORTOPTS;
const char md_shortopts[] = FR30_SHORTOPTS;
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,

View File

@ -200,7 +200,7 @@ const pseudo_typeS md_pseudo_table[] =
#define FRV_SHORTOPTS "G:"
const char * md_shortopts = FRV_SHORTOPTS;
const char md_shortopts[] = FRV_SHORTOPTS;
#define OPTION_GPR_32 (OPTION_MD_BASE)
#define OPTION_GPR_64 (OPTION_MD_BASE + 1)
@ -226,7 +226,7 @@ const char * md_shortopts = FRV_SHORTOPTS;
#define OPTION_FDPIC (OPTION_MD_BASE + 21)
#define OPTION_NOPIC (OPTION_MD_BASE + 22)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mgpr-32", no_argument, NULL, OPTION_GPR_32 },
{ "mgpr-64", no_argument, NULL, OPTION_GPR_64 },
@ -255,7 +255,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* What value to give to bfd_set_gp_size. */
static int g_switch_value = 8;

View File

@ -487,16 +487,16 @@ md_atof (int type, char *litP, int *sizeP)
return NULL;
}
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_NORELAX (OPTION_MD_BASE)
{"norelax", no_argument, NULL, OPTION_NORELAX},
{"no-relax", no_argument, NULL, OPTION_NORELAX},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* We have no target specific options yet, so these next
two functions are empty. */

View File

@ -2076,15 +2076,15 @@ md_atof (int type, char *litP, int *sizeP)
#define OPTION_H_TICK_HEX (OPTION_MD_BASE)
#define OPTION_MACH (OPTION_MD_BASE+1)
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{ "h-tick-hex", no_argument, NULL, OPTION_H_TICK_HEX },
{ "mach", required_argument, NULL, OPTION_MACH },
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct mach_func
{

View File

@ -1631,26 +1631,26 @@ md_estimate_size_before_relax (fragS *fragP, asection *segment ATTRIBUTE_UNUSED)
#ifdef OBJ_ELF
# ifdef WARN_COMMENTS
const char *md_shortopts = "Vc";
const char md_shortopts[] = "Vc";
# else
const char *md_shortopts = "V";
const char md_shortopts[] = "V";
# endif
#else
# ifdef WARN_COMMENTS
const char *md_shortopts = "c";
const char md_shortopts[] = "c";
# else
const char *md_shortopts = "";
const char md_shortopts[] = "";
# endif
#endif
struct option md_longopts[] =
const struct option md_longopts[] =
{
#ifdef WARN_COMMENTS
{"warn-comment", no_argument, NULL, 'c'},
#endif
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -16756,9 +16756,9 @@ bool i386_record_operator (operatorT op,
#endif
#ifdef OBJ_ELF
const char *md_shortopts = "kVQ:sqnO::";
const char md_shortopts[] = "kVQ:sqnO::";
#else
const char *md_shortopts = "qnO::";
const char md_shortopts[] = "qnO::";
#endif
#define OPTION_32 (OPTION_MD_BASE + 0)
@ -16798,7 +16798,7 @@ const char *md_shortopts = "qnO::";
#define OPTION_MUSE_UNALIGNED_VECTOR_MOVE (OPTION_MD_BASE + 34)
#define OPTION_MTLS_CHECK (OPTION_MD_BASE + 35)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"32", no_argument, NULL, OPTION_32},
#if (defined (OBJ_ELF) || defined (TE_PE) || defined (OBJ_MACH_O)) \
@ -16848,7 +16848,7 @@ struct option md_longopts[] =
{"mtls-check", required_argument, NULL, OPTION_MTLS_CHECK},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -210,9 +210,9 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
/* ia64-specific option processing: */
const char *md_shortopts = "m:N:x::";
const char md_shortopts[] = "m:N:x::";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_MCONSTANT_GP (OPTION_MD_BASE + 1)
{"mconstant-gp", no_argument, NULL, OPTION_MCONSTANT_GP},
@ -220,7 +220,7 @@ struct option md_longopts[] =
{"mauto-pic", no_argument, NULL, OPTION_MAUTO_PIC}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static struct
{

View File

@ -101,15 +101,15 @@ enum options
OPTION_CPU_IP2022EXT
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mip2022", no_argument, NULL, OPTION_CPU_IP2022 },
{ "mip2022ext", no_argument, NULL, OPTION_CPU_IP2022EXT },
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
const char md_shortopts[] = "";
int
md_parse_option (int c ATTRIBUTE_UNUSED, const char * arg ATTRIBUTE_UNUSED)

View File

@ -108,12 +108,12 @@ static struct iq2000_hi_fixup * iq2000_hi_fixup_list;
/* Macro hash table, which we will add to. */
extern struct htab *macro_hash;
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,

View File

@ -233,7 +233,7 @@ struct label_fix
/* OPTIONS PROCESSING */
/*****************************************************/
const char *md_shortopts = "hV"; /* catted to std short options */
const char md_shortopts[] = "hV"; /* catted to std short options */
/* added to std long options */
@ -254,7 +254,7 @@ const char *md_shortopts = "hV"; /* catted to std short options */
#define OPTION_MORE (OPTION_MD_BASE + 19)
#define OPTION_NO_MORE (OPTION_MD_BASE + 20)
struct option md_longopts[] = {
const struct option md_longopts[] = {
{ "march", required_argument, NULL, OPTION_MARCH },
{ "check-resources", no_argument, NULL, OPTION_CHECK_RESOURCES },
{ "no-check-resources", no_argument, NULL, OPTION_NO_CHECK_RESOURCES },
@ -273,7 +273,7 @@ struct option md_longopts[] = {
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -85,9 +85,9 @@ const pseudo_typeS md_pseudo_table[] =
/* Target specific command line options. */
const char * md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_MULTIPLY_ENABLED (OPTION_MD_BASE + 1)
{ "mmultiply-enabled", no_argument, NULL, OPTION_MULTIPLY_ENABLED },
@ -109,7 +109,7 @@ struct option md_longopts[] =
{ "mall-enabled", no_argument, NULL, OPTION_ALL_ENABLED },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Display architecture specific options. */

View File

@ -112,7 +112,7 @@ const char EXP_CHARS[] = "eE";
/* or 0d1.2345e12. */
const char FLT_CHARS[] = "rRsSfFdDxXpP";
const char *md_shortopts = "O::g::G:";
const char md_shortopts[] = "O::g::G:";
static const char default_arch[] = DEFAULT_ARCH;
@ -154,7 +154,7 @@ enum options
OPTION_END_OF_ENUM,
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mabi", required_argument, NULL, OPTION_ABI },
@ -172,7 +172,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -61,7 +61,7 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
#define M32C_SHORTOPTS ""
const char * md_shortopts = M32C_SHORTOPTS;
const char md_shortopts[] = M32C_SHORTOPTS;
/* assembler options */
#define OPTION_CPU_M16C (OPTION_MD_BASE)
@ -69,7 +69,7 @@ const char * md_shortopts = M32C_SHORTOPTS;
#define OPTION_LINKRELAX (OPTION_MD_BASE + 2)
#define OPTION_H_TICK_HEX (OPTION_MD_BASE + 3)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "m16c", no_argument, NULL, OPTION_CPU_M16C },
{ "m32c", no_argument, NULL, OPTION_CPU_M32C },
@ -77,7 +77,7 @@ struct option md_longopts[] =
{ "h-tick-hex", no_argument, NULL, OPTION_H_TICK_HEX },
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Default machine */

View File

@ -189,7 +189,7 @@ allow_m32rx (int on)
#define M32R_SHORTOPTS "O::K:"
const char *md_shortopts = M32R_SHORTOPTS;
const char md_shortopts[] = M32R_SHORTOPTS;
enum md_option_enums
{
@ -212,7 +212,7 @@ enum md_option_enums
OPTION_NO_WARN_UNMATCHED
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"m32r", no_argument, NULL, OPTION_M32R},
{"m32rx", no_argument, NULL, OPTION_M32RX},
@ -243,7 +243,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static void
little (int on)

View File

@ -323,9 +323,9 @@ const pseudo_typeS md_pseudo_table[] =
/* Options and initialization. */
const char *md_shortopts = "Sm:";
const char md_shortopts[] = "Sm:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_FORCE_LONG_BRANCH (OPTION_MD_BASE)
{"force-long-branches", no_argument, NULL, OPTION_FORCE_LONG_BRANCH},
@ -364,7 +364,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Get the target cpu for the assembler. This is based on the configure
options and on the -m68hc11/-m68hc12 option. If no option is specified,

View File

@ -7341,9 +7341,9 @@ m68k_set_extension (char const *name, int allow_m, int silent)
Invocation line includes a switch not recognized by the base assembler.
*/
const char *md_shortopts = "lSA:m:kQ:V";
const char md_shortopts[] = "lSA:m:kQ:V";
struct option md_longopts[] = {
const struct option md_longopts[] = {
#define OPTION_PIC (OPTION_MD_BASE)
{"pic", no_argument, NULL, OPTION_PIC},
#define OPTION_REGISTER_PREFIX_OPTIONAL (OPTION_MD_BASE + 1)
@ -7363,7 +7363,7 @@ struct option md_longopts[] = {
{"pcrel", no_argument, NULL, OPTION_PCREL},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -1629,7 +1629,7 @@ md_atof (int type, char * litP, int * sizeP)
return ieee_md_atof (type, litP, sizeP, target_big_endian);
}
const char * md_shortopts = "";
const char md_shortopts[] = "";
enum options
{
@ -1642,7 +1642,7 @@ enum options
OPTION_EL,
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "no-jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_OFF},
{ "jsri2bsr", no_argument, NULL, OPTION_JSRI2BSR_ON},
@ -1654,7 +1654,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char * arg)

View File

@ -139,7 +139,7 @@ static struct mep_hi_fixup * mep_hi_fixup_list;
#define OPTION_NODSP (OPTION_MD_BASE + 32)
#define OPTION_LIBRARY (OPTION_MD_BASE + 33)
struct option md_longopts[] = {
const struct option md_longopts[] = {
{ "EB", no_argument, NULL, OPTION_EB},
{ "EL", no_argument, NULL, OPTION_EL},
{ "mconfig", required_argument, NULL, OPTION_CONFIG},
@ -170,7 +170,7 @@ struct option md_longopts[] = {
{ "mno-dsp", no_argument, NULL, OPTION_NODSP},
{ "mlibrary", no_argument, NULL, OPTION_LIBRARY},
{ NULL, 0, NULL, 0 } };
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Options which default to on/off together. See the comment where
this is used for details. Note that CP and CP64 are not in this
@ -189,7 +189,7 @@ size_t md_longopts_size = sizeof (md_longopts);
| (1 << CGEN_INSN_OPTIONAL_UCI_INSN) \
| (1 << CGEN_INSN_OPTIONAL_DSP_INSN) )
const char * md_shortopts = "";
const char md_shortopts[] = "";
static int optbits = 0;
static int optbitset = 0;

View File

@ -81,13 +81,13 @@ static unsigned int mcpu_opt = CoreMeta12;
static unsigned int mfpu_opt = 0;
static unsigned int mdsp_opt = 0;
const char * md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Parser hash tables. */
static htab_t mnemonic_htab;

View File

@ -1901,9 +1901,9 @@ md_atof (int type, char * litP, int * sizeP)
return NULL;
}
const char * md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"EB", no_argument, NULL, OPTION_EB},
{"EL", no_argument, NULL, OPTION_EL},
@ -1912,7 +1912,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int md_short_jump_size;

View File

@ -1450,7 +1450,7 @@ static const struct mips_cpu_info *mips_cpu_info_from_isa (int);
static const struct mips_cpu_info *mips_cpu_info_from_arch (int);
/* Command-line options. */
const char *md_shortopts = "O::g::G:";
const char md_shortopts[] = "O::g::G:";
enum options
{
@ -1585,7 +1585,7 @@ enum options
OPTION_END_OF_ENUM
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
/* Options which specify architecture. */
{"march", required_argument, NULL, OPTION_MARCH},
@ -1738,7 +1738,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Information about either an Application Specific Extension or an
optional architecture feature that, for simplicity, we treat in the

View File

@ -80,7 +80,7 @@ static void mmix_cons (int);
} \
while (0)
const char *md_shortopts = "x";
const char md_shortopts[] = "x";
static int current_fb_label = -1;
static char *pending_label = NULL;
@ -189,7 +189,7 @@ static int doing_bspec = 0;
static const char *bspec_file;
static unsigned int bspec_line;
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_RELAX (OPTION_MD_BASE)
#define OPTION_NOEXPAND (OPTION_RELAX + 1)
@ -215,7 +215,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static htab_t mmix_opcode_hash;

View File

@ -85,14 +85,14 @@ struct mn10200_fixup
struct mn10200_fixup fixups[MAX_INSN_FIXUPS];
static int fc;
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* The target specific pseudo-ops which we support. */
const pseudo_typeS md_pseudo_table[] =

View File

@ -107,14 +107,14 @@ static int fc;
verify that certain registers do not match. */
int mn10300_reg_operands[MN10300_MAX_OPERANDS];
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
#define HAVE_AM33_2 (current_machine == AM33_2)
#define HAVE_AM33 (current_machine == AM33 || HAVE_AM33_2)

View File

@ -606,16 +606,16 @@ enum options
OPTION_EL,
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "EB", no_argument, NULL, OPTION_EB},
{ "EL", no_argument, NULL, OPTION_EL},
{ NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char *md_shortopts = "";
const char md_shortopts[] = "";
int
md_parse_option (int c ATTRIBUTE_UNUSED, const char *arg ATTRIBUTE_UNUSED)

View File

@ -1742,9 +1742,9 @@ const pseudo_typeS md_pseudo_table[] =
{NULL, NULL, 0}
};
const char *md_shortopts = "mm:,mP,mQ,ml,mN,mn,my,mY,mu,mU";
const char md_shortopts[] = "mm:,mP,mQ,ml,mN,mn,my,mY,mu,mU";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"msilicon-errata", required_argument, NULL, OPTION_SILICON_ERRATA},
{"msilicon-errata-warn", required_argument, NULL, OPTION_SILICON_ERRATA_WARN},
@ -1764,7 +1764,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
void
md_show_usage (FILE * stream)

View File

@ -68,7 +68,7 @@ const pseudo_typeS md_pseudo_table[] =
static int no_scheduling_restrictions = 0;
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_NO_SCHED_REST (OPTION_MD_BASE)
{ "nosched", no_argument, NULL, OPTION_NO_SCHED_REST },
@ -76,9 +76,9 @@ struct option md_longopts[] =
{ "march", required_argument, NULL, OPTION_MARCH},
{ NULL, no_argument, NULL, 0 },
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char * md_shortopts = "";
const char md_shortopts[] = "";
/* Mach selected from command line. */
static int mt_mach = bfd_mach_ms1;

View File

@ -2313,8 +2313,8 @@ enum options
OPTION_OPTIMIZE_SPACE
};
const char *md_shortopts = "m:O:";
struct option md_longopts[] =
const char md_shortopts[] = "m:O:";
const struct option md_longopts[] =
{
{"O1", no_argument, NULL, OPTION_OPTIMIZE},
{"Os", no_argument, NULL, OPTION_OPTIMIZE_SPACE},
@ -2334,7 +2334,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct nds32_parse_option_table
{

View File

@ -68,9 +68,9 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
/* Machine-dependent command-line options. */
const char *md_shortopts = "r";
const char md_shortopts[] = "r";
struct option md_longopts[] = {
const struct option md_longopts[] = {
#define OPTION_RELAX_ALL (OPTION_MD_BASE + 0)
{"relax-all", no_argument, NULL, OPTION_RELAX_ALL},
#define OPTION_NORELAX (OPTION_MD_BASE + 1)
@ -85,7 +85,7 @@ struct option md_longopts[] = {
{"march", required_argument, NULL, OPTION_MARCH}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* The assembler supports three different relaxation modes, controlled by
command-line options. */

View File

@ -2109,16 +2109,16 @@ md_create_long_jump (char *ptr,
md_number_to_disp (ptr + 1, (valueT) offset, 4);
}
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_DISP_SIZE (OPTION_MD_BASE)
{"disp-size-default", required_argument , NULL, OPTION_DISP_SIZE},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -56,13 +56,13 @@ const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
#define OR1K_SHORTOPTS "m:"
const char * md_shortopts = OR1K_SHORTOPTS;
const char md_shortopts[] = OR1K_SHORTOPTS;
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
unsigned long or1k_machine = 0; /* default */

View File

@ -1271,9 +1271,9 @@ set_machine_model (const char *arg)
return 0;
}
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_CPU 257
{ "cpu", required_argument, NULL, OPTION_CPU },
@ -1284,7 +1284,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Invocation line includes a switch not recognized by the base assembler.
See if it's a processor-specific option. */

View File

@ -319,9 +319,9 @@ md_atof (int type, char *litP, int *sizeP)
return ieee_md_atof (type, litP, sizeP, target_big_endian);
}
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_LITTLE (OPTION_MD_BASE)
#define OPTION_BIG (OPTION_LITTLE + 1)
@ -330,7 +330,7 @@ struct option md_longopts[] =
{"big", no_argument, NULL, OPTION_BIG},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -1098,9 +1098,9 @@ unsigned int ppc_apuinfo_num_alloc;
#endif /* OBJ_ELF */
#ifdef OBJ_ELF
const char *const md_shortopts = "b:l:usm:K:VQ:";
const char md_shortopts[] = "b:l:usm:K:VQ:";
#else
const char *const md_shortopts = "um:";
const char md_shortopts[] = "um:";
#endif
#define OPTION_NOPS (OPTION_MD_BASE + 0)
const struct option md_longopts[] = {

View File

@ -75,7 +75,7 @@ struct pru_opt_s
static struct pru_opt_s pru_opt = { true, true };
const char *md_shortopts = "r";
const char md_shortopts[] = "r";
enum options
{
@ -84,7 +84,7 @@ enum options
OPTION_NO_WARN_REGNAME_LABEL,
};
struct option md_longopts[] = {
const struct option md_longopts[] = {
{ "mlink-relax", no_argument, NULL, OPTION_LINK_RELAX },
{ "mno-link-relax", no_argument, NULL, OPTION_NO_LINK_RELAX },
{ "mno-warn-regname-label", no_argument, NULL,
@ -92,7 +92,7 @@ struct option md_longopts[] = {
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
typedef struct pru_insn_reloc
{

View File

@ -4305,7 +4305,7 @@ md_number_to_chars (char *buf, valueT val, int n)
number_to_chars_littleendian (buf, val, n);
}
const char *md_shortopts = "O::g::G:";
const char md_shortopts[] = "O::g::G:";
enum options
{
@ -4326,7 +4326,7 @@ enum options
OPTION_END_OF_ENUM
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"march", required_argument, NULL, OPTION_MARCH},
{"fPIC", no_argument, NULL, OPTION_PIC},
@ -4346,7 +4346,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -288,10 +288,10 @@ enum options
};
#define RL78_SHORTOPTS ""
const char * md_shortopts = RL78_SHORTOPTS;
const char md_shortopts[] = RL78_SHORTOPTS;
/* Assembler options. */
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"relax", no_argument, NULL, OPTION_RELAX},
{"norelax", no_argument, NULL, OPTION_NORELAX},
@ -303,7 +303,7 @@ struct option md_longopts[] =
{"m64bit-doubles", no_argument, NULL, OPTION_64BIT_DOUBLES},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)

View File

@ -78,10 +78,10 @@ enum options
};
#define RX_SHORTOPTS ""
const char * md_shortopts = RX_SHORTOPTS;
const char md_shortopts[] = RX_SHORTOPTS;
/* Assembler options. */
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"mbig-endian-data", no_argument, NULL, OPTION_BIG},
{"mlittle-endian-data", no_argument, NULL, OPTION_LITTLE},
@ -105,7 +105,7 @@ struct option md_longopts[] =
{"mno-allow-string-insns", no_argument, NULL, OPTION_DISALLOW_STRING_INSNS},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct cpu_type
{

View File

@ -84,9 +84,9 @@ s12z_strtol (const char *str, char ** endptr)
/* Options and initialization. */
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_REG_PREFIX (OPTION_MD_BASE)
{"mreg-prefix", required_argument, NULL, OPTION_REG_PREFIX},
@ -95,7 +95,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
relax_typeS md_relax_table[] =

View File

@ -254,11 +254,11 @@ int md_short_jump_size = 4;
int md_long_jump_size = 4;
#endif
const char *md_shortopts = "A:m:kVQ:";
struct option md_longopts[] = {
const char md_shortopts[] = "A:m:kVQ:";
const struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Initialize the default opcode arch and word size from the default
architecture name if not specified by an option. */

View File

@ -216,8 +216,8 @@ const pseudo_typeS md_pseudo_table[] =
{0, 0, 0}
};
const char *md_shortopts = "nO::g::G:";
struct option md_longopts[] =
const char md_shortopts[] = "nO::g::G:";
const struct option md_longopts[] =
{
#ifdef OPTION_EB
{"EB" , no_argument, NULL, OPTION_EB},
@ -239,7 +239,7 @@ struct option md_longopts[] =
{NULL , no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
#define s3_GP 28
#define s3_PIC_CALL_REG 29

View File

@ -2708,8 +2708,8 @@ enum options
OPTION_DUMMY /* Not used. This is just here to make it easy to add and subtract options from this enum. */
};
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{"relax", no_argument, NULL, OPTION_RELAX},
{"big", no_argument, NULL, OPTION_BIG},
@ -2732,7 +2732,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -401,8 +401,8 @@ sparc_target_format (void)
* error. For example, from sparclite to v9.
*/
const char *md_shortopts = "A:K:VQ:sq";
struct option md_longopts[] = {
const char md_shortopts[] = "A:K:VQ:sq";
const struct option md_longopts[] = {
#define OPTION_BUMP (OPTION_MD_BASE)
{"bump", no_argument, NULL, OPTION_BUMP},
#define OPTION_SPARC (OPTION_MD_BASE + 1)
@ -442,7 +442,7 @@ struct option md_longopts[] = {
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -120,8 +120,8 @@ md_begin (void)
str_hash_insert (op_hash, spu_opcodes[i].mnemonic, &spu_opcodes[i], 0);
}
const char *md_shortopts = "";
struct option md_longopts[] = {
const char md_shortopts[] = "";
const struct option md_longopts[] = {
#define OPTION_APUASM (OPTION_MD_BASE)
{"apuasm", no_argument, NULL, OPTION_APUASM},
#define OPTION_DD2 (OPTION_MD_BASE+1)
@ -132,7 +132,7 @@ struct option md_longopts[] = {
{"mdd3.0", no_argument, NULL, OPTION_DD3},
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* When set (by -apuasm) our assembler emulates the behaviour of apuasm.
* e.g. don't add bias to float conversion and don't right shift

View File

@ -40,13 +40,13 @@ const char comment_chars[] = ";";
const char line_comment_chars[] = "*";
const char line_separator_chars[] = "";
const char *md_shortopts = "";
struct option md_longopts[] =
const char md_shortopts[] = "";
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* Chars that mean this number is a floating point constant.
As in 0f12.456

View File

@ -77,8 +77,8 @@ static unsigned long tic4x_oplevel = 0; /* Opcode level */
#define OPTION_ENHANCED (OPTION_MD_BASE + 7)
#define OPTION_REV (OPTION_MD_BASE + 8)
const char *md_shortopts = "bm:prs";
struct option md_longopts[] =
const char md_shortopts[] = "bm:prs";
const struct option md_longopts[] =
{
{ "mcpu", required_argument, NULL, OPTION_CPU },
{ "mdsp", required_argument, NULL, OPTION_CPU },
@ -93,8 +93,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
typedef enum
{

View File

@ -138,14 +138,14 @@ const char FLT_CHARS[] = "fF";
nums. */
const char EXP_CHARS[] = "eE";
const char *md_shortopts = "";
const char md_shortopts[] = "";
#define OPTION_ADDRESS_MODE (OPTION_MD_BASE)
#define OPTION_CPU_VERSION (OPTION_ADDRESS_MODE + 1)
#define OPTION_COFF_VERSION (OPTION_CPU_VERSION + 1)
#define OPTION_STDERR_TO_FILE (OPTION_COFF_VERSION + 1)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "mfar-mode", no_argument, NULL, OPTION_ADDRESS_MODE },
{ "mf", no_argument, NULL, OPTION_ADDRESS_MODE },
@ -155,7 +155,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0},
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static int assembly_begun = 0;
/* Addressing mode is not entirely implemented; the latest rev of the Other

View File

@ -48,7 +48,7 @@ const char line_separator_chars[] = "@";
const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dDfF";
const char *md_shortopts = "";
const char md_shortopts[] = "";
enum
{
@ -63,7 +63,7 @@ enum
OPTION_MGENERATE_REL
};
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "march", required_argument, NULL, OPTION_MARCH },
{ "mbig-endian", no_argument, NULL, OPTION_MBIG_ENDIAN },
@ -76,7 +76,7 @@ struct option md_longopts[] =
{ "mgenerate-rel", no_argument, NULL, OPTION_MGENERATE_REL },
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* The instructions enabled based only on the selected architecture
(all instructions, if no architecture specified). */

View File

@ -84,9 +84,9 @@ tilegx_target_format (void)
#define OPTION_EB (OPTION_MD_BASE + 2)
#define OPTION_EL (OPTION_MD_BASE + 3)
const char *md_shortopts = "VQ:";
const char md_shortopts[] = "VQ:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{"32", no_argument, NULL, OPTION_32},
{"64", no_argument, NULL, OPTION_64},
@ -95,7 +95,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -61,14 +61,14 @@ const char EXP_CHARS[] = "eE";
as in 0d1.0. */
const char FLT_CHARS[] = "rRsSfFdDxXpP";
const char *md_shortopts = "VQ:";
const char md_shortopts[] = "VQ:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)

View File

@ -1515,9 +1515,9 @@ parse_register_list (unsigned long *insn,
return NULL;
}
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_DISP_SIZE_DEFAULT_22 (OPTION_MD_BASE)
{"disp-size-default-22", no_argument, NULL, OPTION_DISP_SIZE_DEFAULT_22},
@ -1526,7 +1526,7 @@ struct option md_longopts[] =
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
static bool v850_data_8 = false;

View File

@ -2190,18 +2190,18 @@ md_create_long_jump (char *ptr,
}
#ifdef OBJ_ELF
const char *md_shortopts = "d:STt:VkQ:";
const char md_shortopts[] = "d:STt:VkQ:";
#else
const char *md_shortopts = "d:STt:V";
const char md_shortopts[] = "d:STt:V";
#endif
struct option md_longopts[] =
const struct option md_longopts[] =
{
#ifdef OBJ_ELF
{ "pic", no_argument, NULL, 'k' },
#endif
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -218,14 +218,14 @@ md_undefined_symbol (char *name ATTRIBUTE_UNUSED)
}
/* The parse options. */
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
struct visium_option_table
{

View File

@ -78,7 +78,7 @@ const char comment_chars[] = ";#";
const char line_comment_chars[] = ";#";
const char line_separator_chars[] = "";
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
const char EXP_CHARS[] = "eE";
const char FLT_CHARS[] = "dD";
@ -94,12 +94,12 @@ const pseudo_typeS md_pseudo_table[] =
static htab_t wasm32_hash;
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
/* No relaxation/no machine-dependent frags. */

View File

@ -163,9 +163,9 @@ const pseudo_typeS md_pseudo_table[] =
{0, 0, 0}
};
const char *md_shortopts = "m:";
const char md_shortopts[] = "m:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_PRINT_INSN_SYNTAX (OPTION_MD_BASE + 0)
{ "print-insn-syntax", no_argument, NULL, OPTION_PRINT_INSN_SYNTAX },
@ -191,7 +191,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
const char *
md_atof (int type, char *litP, int *sizeP)

View File

@ -56,13 +56,13 @@ const char FLT_CHARS[] = "dD";
#define O_fptr_symbol (O_max + 1)
#define XSTORMY16_SHORTOPTS ""
const char * md_shortopts = XSTORMY16_SHORTOPTS;
const char md_shortopts[] = XSTORMY16_SHORTOPTS;
struct option md_longopts[] =
const struct option md_longopts[] =
{
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c ATTRIBUTE_UNUSED,

View File

@ -735,9 +735,9 @@ enum
option_abi_call0,
};
const char *md_shortopts = "";
const char md_shortopts[] = "";
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "density", no_argument, NULL, option_density },
{ "no-density", no_argument, NULL, option_no_density },
@ -820,8 +820,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof md_longopts;
const size_t md_longopts_size = sizeof md_longopts;
int
md_parse_option (int c, const char *arg)

View File

@ -34,7 +34,7 @@ const char EXP_CHARS[] = "eE\0";
const char FLT_CHARS[] = "RrDdFfSsHh\0";
/* For machine specific options. */
const char * md_shortopts = ""; /* None yet. */
const char md_shortopts[] = ""; /* None yet. */
enum options
{
@ -80,7 +80,7 @@ enum options
#define INS_UNDOC (INS_IDX_HALF | INS_IN_F_C)
#define INS_UNPORT (INS_OUT_C_0 | INS_SLI | INS_ROT_II_LD)
struct option md_longopts[] =
const struct option md_longopts[] =
{
{ "march", required_argument, NULL, OPTION_MARCH},
{ "z80", no_argument, NULL, OPTION_MACH_Z80},
@ -115,7 +115,7 @@ struct option md_longopts[] =
{ NULL, no_argument, NULL, 0 }
} ;
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
extern int coff_flags;
/* Instruction classes that silently assembled. */

View File

@ -1309,16 +1309,16 @@ md_atof (int type, char *litP, int *sizeP)
return ieee_md_atof (type, litP, sizeP, true);
}
const char *md_shortopts = "z:";
const char md_shortopts[] = "z:";
struct option md_longopts[] =
const struct option md_longopts[] =
{
#define OPTION_RELAX (OPTION_MD_BASE)
{"linkrelax", no_argument, NULL, OPTION_RELAX},
{NULL, no_argument, NULL, 0}
};
size_t md_longopts_size = sizeof (md_longopts);
const size_t md_longopts_size = sizeof (md_longopts);
int
md_parse_option (int c, const char *arg)

View File

@ -814,7 +814,7 @@ zero if the target is little endian.
@cindex md_show_usage
@cindex md_after_parse_args
GAS uses these variables and functions during option processing.
@code{md_shortopts} is a @code{const char *} which GAS adds to the machine
@code{md_shortopts} is a @code{const char []} which GAS adds to the machine
independent string passed to @code{getopt}. @code{md_longopts} is a
@code{struct option []} which GAS adds to the machine independent long options
passed to @code{getopt}; you may use @code{OPTION_MD_BASE}, defined in

View File

@ -22,6 +22,10 @@
/* In theory (mine, at least!) the machine dependent part of the assembler
should only have to include one file. This one. -- JF */
extern const char md_shortopts[];
extern const struct option md_longopts[];
extern const size_t md_longopts_size;
extern const pseudo_typeS md_pseudo_table[];
const char * md_atof (int, char *, int *);