diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2001-10-16 02:36:20 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2001-10-16 02:36:20 +0000 |
commit | 05982cacb924d76c8a040683149ef0e58c208016 (patch) | |
tree | 6848bf89767c7ae8e6002938f4fd23ad15a87a0d /gas/config/tc-sh.c | |
parent | 1aa20aa88f25187a6947acc8d8ccaeb97daaa4d0 (diff) | |
download | fsf-binutils-gdb-05982cacb924d76c8a040683149ef0e58c208016.zip fsf-binutils-gdb-05982cacb924d76c8a040683149ef0e58c208016.tar.gz fsf-binutils-gdb-05982cacb924d76c8a040683149ef0e58c208016.tar.bz2 |
* config/tc-sh.c (shl): Remove.
(big): New function.
(little): Remove shl handling. Emit error for endian mismatch.
(md_show_usage): Add description of -big.
(md_parse_option): Handle OPTION_BIG. Remove shl handling.
(OPTION_BIG): Add.
(md_pseudo_table): Add .big.
(md_longopts): Add -big.
(md_begin): Don't set target_big_endian here.
* config/tc-sh.h (TARGET_BYTES_BIG_ENDIAN): Remove.
(LISTING_HEADER, COFF_MAGIC, TARGET_FORMAT): Use target_big_endian.
(shl): Remove.
* configure.in (endian): Default is big.
(sh-*-pe*): Little endian.
(cpu_type): Set sh for target sh*.
* configure: Regenerate.
Diffstat (limited to 'gas/config/tc-sh.c')
-rw-r--r-- | gas/config/tc-sh.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c index 8869a82..b235cdd 100644 --- a/gas/config/tc-sh.c +++ b/gas/config/tc-sh.c @@ -57,6 +57,7 @@ static void s_uacons PARAMS ((int)); static sh_opcode_info *find_cooked_opcode PARAMS ((char **)); static unsigned int assemble_ppi PARAMS ((char *, sh_opcode_info *)); static void little PARAMS ((int)); +static void big PARAMS ((int)); static bfd_reloc_code_real_type sh_elf_suffix PARAMS ((char **str_p, expressionS *, expressionS *new_exp_p)); static int parse_reg PARAMS ((char *, int *, int *)); @@ -80,13 +81,25 @@ static void sh_elf_cons PARAMS ((int)); symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE_" */ #endif -int shl = 0; +static void +big (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + if (! target_big_endian) + as_bad (_("directive .big encountered when option -big required")); + + /* Stop further messages. */ + target_big_endian = 1; +} static void little (ignore) int ignore ATTRIBUTE_UNUSED; { - shl = 1; + if (target_big_endian) + as_bad (_("directive .little encountered when option -little required")); + + /* Stop further messages. */ target_big_endian = 0; } @@ -107,6 +120,7 @@ const pseudo_typeS md_pseudo_table[] = {"int", cons, 4}, {"word", cons, 2}, #endif /* OBJ_ELF */ + {"big", big, 0}, {"form", listing_psize, 0}, {"little", little, 0}, {"heading", listing_title, 0}, @@ -439,14 +453,6 @@ md_begin () char *prev_name = ""; int target_arch; -#ifdef TE_PE - /* The WinCE OS only supports little endian executables. */ - target_big_endian = 0; -#else - if (! shl) - target_big_endian = 1; -#endif - target_arch = arch_sh1_up & ~(sh_dsp ? arch_sh3e_up : arch_sh_dsp_up); valid_arch = target_arch; @@ -2127,11 +2133,13 @@ CONST char *md_shortopts = ""; struct option md_longopts[] = { #define OPTION_RELAX (OPTION_MD_BASE) -#define OPTION_LITTLE (OPTION_MD_BASE + 1) +#define OPTION_BIG (OPTION_MD_BASE + 1) +#define OPTION_LITTLE (OPTION_BIG + 1) #define OPTION_SMALL (OPTION_LITTLE + 1) #define OPTION_DSP (OPTION_SMALL + 1) {"relax", no_argument, NULL, OPTION_RELAX}, + {"big", no_argument, NULL, OPTION_BIG}, {"little", no_argument, NULL, OPTION_LITTLE}, {"small", no_argument, NULL, OPTION_SMALL}, {"dsp", no_argument, NULL, OPTION_DSP}, @@ -2150,8 +2158,11 @@ md_parse_option (c, arg) sh_relax = 1; break; + case OPTION_BIG: + target_big_endian = 1; + break; + case OPTION_LITTLE: - shl = 1; target_big_endian = 0; break; @@ -2177,6 +2188,7 @@ md_show_usage (stream) fprintf (stream, _("\ SH options:\n\ -little generate little endian code\n\ +-big generate big endian code\n\ -relax alter jump instructions for long displacements\n\ -small align sections to 4 byte boundaries, not 16\n\ -dsp enable sh-dsp insns, and disable sh3e / sh4 insns.\n")); |