aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-xtensa.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2017-05-17 02:09:14 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2017-06-14 11:05:50 -0700
commitf7e16c2a9cc405707e646e951397938d2b4eea48 (patch)
tree43663c7cb39d2994e7fe2572c91a8026c1c63d38 /gas/config/tc-xtensa.h
parentb46c4cf0908b05ab493d4f30e9a52a887ee118fd (diff)
downloadfsf-binutils-gdb-f7e16c2a9cc405707e646e951397938d2b4eea48.zip
fsf-binutils-gdb-f7e16c2a9cc405707e646e951397938d2b4eea48.tar.gz
fsf-binutils-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.h')
-rw-r--r--gas/config/tc-xtensa.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gas/config/tc-xtensa.h b/gas/config/tc-xtensa.h
index 257ca05..912c890 100644
--- a/gas/config/tc-xtensa.h
+++ b/gas/config/tc-xtensa.h
@@ -30,7 +30,7 @@ struct fix;
#include "xtensa-isa.h"
#include "xtensa-config.h"
-#define TARGET_BYTES_BIG_ENDIAN XCHAL_HAVE_BE
+#define TARGET_BYTES_BIG_ENDIAN 0
/* Maximum number of opcode slots in a VLIW instruction. */
@@ -335,6 +335,13 @@ extern bfd_boolean xtensa_check_inside_bundle (void);
extern void xtensa_handle_align (fragS *);
extern char *xtensa_section_rename (const char *);
+/* We need to set the target endianness in xtensa_init and not in md_begin.
+ This is because xtensa_target_format is called before md_begin, and we
+ want to have all non-statically initialized fields initialized. */
+
+#define HOST_SPECIAL_INIT xtensa_init
+extern void xtensa_init (int, char **);
+
#define TARGET_FORMAT xtensa_target_format ()
#define TARGET_ARCH bfd_arch_xtensa
#define TC_SEGMENT_INFO_TYPE xtensa_segment_info