mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-28 10:00:51 +00:00
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.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2016-01-02 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* arch.h (TARGET_BIG_ENDIAN): Delete.
|
||||
* configure.ac (SIM_AC_OPTION_ENDIAN): Change BIG_ENDIAN to BIG.
|
||||
* configure: Regenerate.
|
||||
* traps-linux.c (conv_endian): Change LITTLE_ENDIAN to
|
||||
BFD_ENDIAN_LITTLE.
|
||||
(conv_endian16): Likewise.
|
||||
|
||||
2016-01-02 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* sim-if.c (sim_open): Delete #if 0 sim_add_option_table call.
|
||||
|
||||
@@ -24,8 +24,6 @@ This file is part of the GNU simulators.
|
||||
#ifndef M32R_ARCH_H
|
||||
#define M32R_ARCH_H
|
||||
|
||||
#define TARGET_BIG_ENDIAN 1
|
||||
|
||||
/* Enum declaration for model types. */
|
||||
typedef enum model_type {
|
||||
MODEL_M32R_D, MODEL_TEST, MODEL_M32RX, MODEL_M32R2
|
||||
|
||||
36
sim/m32r/configure
vendored
36
sim/m32r/configure
vendored
@@ -12920,31 +12920,31 @@ sim_link_links="${sim_link_links} targ-vals.def"
|
||||
|
||||
|
||||
|
||||
wire_endian="BIG_ENDIAN"
|
||||
wire_endian="BIG"
|
||||
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="";;
|
||||
@@ -12954,10 +12954,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
|
||||
@@ -13014,9 +13014,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
|
||||
@@ -13250,12 +13250,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
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ sinclude(../common/acinclude.m4)
|
||||
|
||||
SIM_AC_COMMON
|
||||
|
||||
SIM_AC_OPTION_ENDIAN(BIG_ENDIAN)
|
||||
SIM_AC_OPTION_ENDIAN(BIG)
|
||||
SIM_AC_OPTION_ALIGNMENT(STRICT_ALIGNMENT)
|
||||
SIM_AC_OPTION_HOSTENDIAN
|
||||
SIM_AC_OPTION_SCACHE(16384)
|
||||
|
||||
@@ -136,7 +136,7 @@ conv_endian (unsigned int tvalue)
|
||||
unsigned int hvalue;
|
||||
unsigned int t1, t2, t3, t4;
|
||||
|
||||
if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN)
|
||||
if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE)
|
||||
{
|
||||
t1 = tvalue & 0xff000000;
|
||||
t2 = tvalue & 0x00ff0000;
|
||||
@@ -160,7 +160,7 @@ conv_endian16 (unsigned short tvalue)
|
||||
unsigned short hvalue;
|
||||
unsigned short t1, t2;
|
||||
|
||||
if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN)
|
||||
if (CURRENT_HOST_BYTE_ORDER == BFD_ENDIAN_LITTLE)
|
||||
{
|
||||
t1 = tvalue & 0xff00;
|
||||
t2 = tvalue & 0x00ff;
|
||||
|
||||
Reference in New Issue
Block a user