diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-01-02 17:46:16 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-01-03 00:18:07 -0500 |
commit | 1ac72f0659d64d6a14da862242db0d841d2878d0 (patch) | |
tree | d7d792ba2df8227b99240650e99087e1f6008813 /sim/cris | |
parent | 987f8739051ff368ecaf6ca1e0fc966c974381a1 (diff) | |
download | gdb-1ac72f0659d64d6a14da862242db0d841d2878d0.zip gdb-1ac72f0659d64d6a14da862242db0d841d2878d0.tar.gz gdb-1ac72f0659d64d6a14da862242db0d841d2878d0.tar.bz2 |
sim: convert to bfd_endian
Rather than re-invent endian defines, as well as maintain our own list
of OS & arch-specific includes, punt all that logic in favor of the bfd
ones already set up and maintained elsewhere. We already rely on the
bfd library, so leveraging the endian aspect should be fine.
Diffstat (limited to 'sim/cris')
-rw-r--r-- | sim/cris/ChangeLog | 7 | ||||
-rw-r--r-- | sim/cris/arch.h | 2 | ||||
-rwxr-xr-x | sim/cris/configure | 36 | ||||
-rw-r--r-- | sim/cris/configure.ac | 2 |
4 files changed, 26 insertions, 21 deletions
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog index 1e28c12..79ce999 100644 --- a/sim/cris/ChangeLog +++ b/sim/cris/ChangeLog @@ -1,5 +1,12 @@ 2016-01-02 Mike Frysinger <vapier@gentoo.org> + * arch.h (TARGET_BIG_ENDIAN): Delete. + * configure.ac (SIM_AC_OPTION_ENDIAN): Change LITTLE_ENDIAN to + LITTLE. + * configure: Regenerate. + +2016-01-02 Mike Frysinger <vapier@gentoo.org> + * sim-if.c (xprintf, eprintf): Delete. (cris_load_elf_file): Delete callback. Change xprintf to sim_io_printf and eprintf to sim_io_eprintf. diff --git a/sim/cris/arch.h b/sim/cris/arch.h index f765f4a..efd861f 100644 --- a/sim/cris/arch.h +++ b/sim/cris/arch.h @@ -24,8 +24,6 @@ This file is part of the GNU simulators. #ifndef CRIS_ARCH_H #define CRIS_ARCH_H -#define TARGET_BIG_ENDIAN 1 - /* Enum declaration for model types. */ typedef enum model_type { MODEL_CRISV10, MODEL_CRISV32, MODEL_MAX diff --git a/sim/cris/configure b/sim/cris/configure index be7f6fc..9914337 100755 --- a/sim/cris/configure +++ b/sim/cris/configure @@ -12942,31 +12942,31 @@ done -wire_endian="LITTLE_ENDIAN" +wire_endian="LITTLE" default_endian="" # Check whether --enable-sim-endian was given. if test "${enable_sim_endian+set}" = set; then : enableval=$enable_sim_endian; case "${enableval}" in - b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BIG_ENDIAN";; - l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=LITTLE_ENDIAN";; + b*|B*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_BIG";; + l*|L*) sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_LITTLE";; yes) if test x"$wire_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}" + sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" else - if test x"$default_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=${default_endian}" + if test x"$default_endian" != x; then + sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" else echo "No hard-wired endian for target $target" 1>&6 - sim_endian="-DWITH_TARGET_BYTE_ORDER=0" + sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" fi fi;; no) if test x"$default_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" else if test x"$wire_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${wire_endian}" + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" else echo "No default endian for target $target" 1>&6 - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=0" + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" fi fi;; *) as_fn_error "\"Unknown value $enableval for --enable-sim-endian\"" "$LINENO" 5; sim_endian="";; @@ -12976,10 +12976,10 @@ if test x"$silent" != x"yes" && test x"$sim_endian" != x""; then fi else if test x"$default_endian" != x; then - sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=${default_endian}" + sim_endian="-DWITH_DEFAULT_TARGET_BYTE_ORDER=BFD_ENDIAN_${default_endian}" else if test x"$wire_endian" != x; then - sim_endian="-DWITH_TARGET_BYTE_ORDER=${wire_endian}" + sim_endian="-DWITH_TARGET_BYTE_ORDER=BFD_ENDIAN_${wire_endian}" else sim_endian= fi @@ -13036,9 +13036,9 @@ fi # Check whether --enable-sim-hostendian was given. if test "${enable_sim_hostendian+set}" = set; then : enableval=$enable_sim_hostendian; case "${enableval}" in - no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=0";; - b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN";; - l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN";; + no) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_UNKNOWN";; + b*|B*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_BIG";; + l*|L*) sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_LITTLE";; *) as_fn_error "\"Unknown value $enableval for --enable-sim-hostendian\"" "$LINENO" 5; sim_hostendian="";; esac if test x"$silent" != x"yes" && test x"$sim_hostendian" != x""; then @@ -13272,12 +13272,12 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h esac if test $ac_cv_c_bigendian = yes; then - sim_hostendian="-DWITH_HOST_BYTE_ORDER=BIG_ENDIAN" + sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_BIG" else - sim_hostendian="-DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN" + sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_LITTLE" fi else - sim_hostendian="-DWITH_HOST_BYTE_ORDER=0" + sim_hostendian="-DWITH_HOST_BYTE_ORDER=BFD_ENDIAN_UNKNOWN" fi fi diff --git a/sim/cris/configure.ac b/sim/cris/configure.ac index 4e6b1be..5b384a2 100644 --- a/sim/cris/configure.ac +++ b/sim/cris/configure.ac @@ -8,7 +8,7 @@ SIM_AC_COMMON # For dv-rv and rvdummy. AC_CHECK_HEADERS(sys/socket.h sys/select.h limits.h sys/param.h) -SIM_AC_OPTION_ENDIAN(LITTLE_ENDIAN) +SIM_AC_OPTION_ENDIAN(LITTLE) SIM_AC_OPTION_ALIGNMENT(NONSTRICT_ALIGNMENT) SIM_AC_OPTION_HOSTENDIAN SIM_AC_OPTION_SCACHE(16384) |