diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2017-05-17 02:09:14 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2017-06-14 11:05:50 -0700 |
commit | f7e16c2a9cc405707e646e951397938d2b4eea48 (patch) | |
tree | 43663c7cb39d2994e7fe2572c91a8026c1c63d38 /gas/config/tc-xtensa.c | |
parent | b46c4cf0908b05ab493d4f30e9a52a887ee118fd (diff) | |
download | gdb-f7e16c2a9cc405707e646e951397938d2b4eea48.zip gdb-f7e16c2a9cc405707e646e951397938d2b4eea48.tar.gz gdb-f7e16c2a9cc405707e646e951397938d2b4eea48.tar.bz2 |
xtensa: don't expect XCHAL_* macros to be constant
Get rid of the assumption that XCHAL_* macros are preprocessor
constants: don't use them in preprocessor conditionals or in static
variable initializers.
2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
bfd/
* elf32-xtensa.c (elf_xtensa_be_plt_entry,
elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
keep both windowed and call0 ABI PLT definitions.
(elf_xtensa_create_plt_entry): Use selected ABI to choose upper
elf_xtensa_*_plt_entry endex.
(ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
gas/
* config/tc-xtensa.c (density_supported, xtensa_fetch_width,
absolute_literals_supported): Leave definitions uninitialized.
(directive_state): Leave entries for directive_density and
directive_absolute_literals initialized to false.
(xg_init_global_config, xtensa_init): New functions.
* config/tc-xtensa.h (TARGET_BYTES_BIG_ENDIAN): Define as 0.
(HOST_SPECIAL_INIT): New definition.
(xtensa_init): New declaration.
Diffstat (limited to 'gas/config/tc-xtensa.c')
-rw-r--r-- | gas/config/tc-xtensa.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index e1efaae..836b550 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -72,13 +72,13 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP"; /* Flags to indicate whether the hardware supports the density and absolute literals options. */ -bfd_boolean density_supported = XCHAL_HAVE_DENSITY; -bfd_boolean absolute_literals_supported = XSHAL_USE_ABSOLUTE_LITERALS; +bfd_boolean density_supported; +bfd_boolean absolute_literals_supported; static vliw_insn cur_vinsn; unsigned xtensa_num_pipe_stages; -unsigned xtensa_fetch_width = XCHAL_INST_FETCH_WIDTH; +unsigned xtensa_fetch_width; static enum debug_info_type xt_saved_debug_type = DEBUG_NONE; @@ -419,21 +419,13 @@ bfd_boolean directive_state[] = { FALSE, /* none */ FALSE, /* literal */ -#if !XCHAL_HAVE_DENSITY FALSE, /* density */ -#else - TRUE, /* density */ -#endif TRUE, /* transform */ FALSE, /* freeregs */ FALSE, /* longcalls */ FALSE, /* literal_prefix */ FALSE, /* schedule */ -#if XSHAL_USE_ABSOLUTE_LITERALS - TRUE /* absolute_literals */ -#else FALSE /* absolute_literals */ -#endif }; /* A circular list of all potential and actual literal pool locations @@ -5216,6 +5208,24 @@ md_number_to_chars (char *buf, valueT val, int n) number_to_chars_littleendian (buf, val, n); } +static void +xg_init_global_config (void) +{ + target_big_endian = XCHAL_HAVE_BE; + + density_supported = XCHAL_HAVE_DENSITY; + absolute_literals_supported = XSHAL_USE_ABSOLUTE_LITERALS; + xtensa_fetch_width = XCHAL_INST_FETCH_WIDTH; + + directive_state[directive_density] = XCHAL_HAVE_DENSITY; + directive_state[directive_absolute_literals] = XSHAL_USE_ABSOLUTE_LITERALS; +} + +void +xtensa_init (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) +{ + xg_init_global_config (); +} /* This function is called once, at assembler startup time. It should set up all the tables, etc. that the MD part of the assembler will |