+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * system.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
+
2022-10-16 Yonggang Luo <luoyonggang@gmail.com>
* system.h: Add sys/mman.h as system dependend header.
exit (EXIT_FAILURE); \
} while (0)
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
# define LE32(n) (n)
# define LE64(n) (n)
# define BE32(n) bswap_32 (n)
# define BE64(n) bswap_64 (n)
-#elif __BYTE_ORDER == __BIG_ENDIAN
+#elif BYTE_ORDER == BIG_ENDIAN
# define BE32(n) (n)
# define BE64(n) (n)
# define LE32(n) bswap_32 (n)
+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
+ * riscv_disasm.c: Likewise.
+
2021-12-04 Mark Wielaard <mark@klomp.org>
* Makefile.am (GENDIS_ENV): New variable, depends on
#include "../libebl/libeblP.h"
-#define MACHINE_ENCODING __LITTLE_ENDIAN
+#define MACHINE_ENCODING LITTLE_ENDIAN
#include "memory-access.h"
#ifndef MACHINE_ENCODING
# error "MACHINE_ENCODING needs to be defined"
#endif
-#if MACHINE_ENCODING != __BIG_ENDIAN && MACHINE_ENCODING != __LITTLE_ENDIAN
+#if MACHINE_ENCODING != BIG_ENDIAN && MACHINE_ENCODING != LITTLE_ENDIAN
# error "MACHINE_ENCODING must signal either big or little endian"
#endif
#if ALLOW_UNALIGNED
# define read_2ubyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? bswap_16 (*((const uint16_t *) (Addr))) \
: *((const uint16_t *) (Addr)))
# define read_2sbyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? (int16_t) bswap_16 (*((const int16_t *) (Addr))) \
: *((const int16_t *) (Addr)))
# define read_4ubyte_unaligned_noncvt(Addr) \
*((const uint32_t *) (Addr))
# define read_4ubyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? bswap_32 (*((const uint32_t *) (Addr))) \
: *((const uint32_t *) (Addr)))
# define read_4sbyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? (int32_t) bswap_32 (*((const int32_t *) (Addr))) \
: *((const int32_t *) (Addr)))
# define read_8ubyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? bswap_64 (*((const uint64_t *) (Addr))) \
: *((const uint64_t *) (Addr)))
# define read_8sbyte_unaligned(Addr) \
- (unlikely (MACHINE_ENCODING != __BYTE_ORDER) \
+ (unlikely (MACHINE_ENCODING != BYTE_ORDER) \
? (int64_t) bswap_64 (*((const int64_t *) (Addr))) \
: *((const int64_t *) (Addr)))
read_2ubyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return bswap_16 (up->u2);
return up->u2;
}
read_2sbyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return (int16_t) bswap_16 (up->u2);
return up->s2;
}
read_4ubyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return bswap_32 (up->u4);
return up->u4;
}
read_4sbyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return (int32_t) bswap_32 (up->u4);
return up->s4;
}
read_8ubyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return bswap_64 (up->u8);
return up->u8;
}
read_8sbyte_unaligned (const void *p)
{
const union unaligned *up = p;
- if (MACHINE_ENCODING != __BYTE_ORDER)
+ if (MACHINE_ENCODING != BYTE_ORDER)
return (int64_t) bswap_64 (up->u8);
return up->s8;
}
#include "../libebl/libeblP.h"
-#define MACHINE_ENCODING __LITTLE_ENDIAN
+#define MACHINE_ENCODING LITTLE_ENDIAN
#include "memory-access.h"
+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * memory-access.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
+
2022-09-13 Aleksei Vetrov <vvvvvv@google.com>
* libdw.map (ELFUTILS_0.188): Add dwfl_report_offline_memory.
static inline int
file_byte_order (bool other_byte_order)
{
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- return other_byte_order ? __BIG_ENDIAN : __LITTLE_ENDIAN;
+#if BYTE_ORDER == LITTLE_ENDIAN
+ return other_byte_order ? BIG_ENDIAN : LITTLE_ENDIAN;
#else
- return other_byte_order ? __LITTLE_ENDIAN : __BIG_ENDIAN;
+ return other_byte_order ? LITTLE_ENDIAN : BIG_ENDIAN;
#endif
}
} d;
bool other_byte_order = dbg->other_byte_order;
- if (file_byte_order (other_byte_order) == __BIG_ENDIAN)
+ if (file_byte_order (other_byte_order) == BIG_ENDIAN)
{
d.c[0] = 0x00;
d.c[1] = p[0];
+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * dwfl_segment_report_module.c: Use BYTE_ORDER, LITTLE_ENDIAN and
+ BIG_ENDIAN.
+
2022-09-13 Aleksei Vetrov <vvvvvv@google.com>
* libdwfl.h (dwfl_report_offline_memory): New function.
#define INITIAL_READ 1024
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
# define MY_ELFDATA ELFDATA2LSB
#else
# define MY_ELFDATA ELFDATA2MSB
+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * elf32_checksum.c: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
+ * elf32_xlatetof.c: Likewise.
+ * elf_getarsym.c: Likewise.
+
2022-10-16 Yonggang Luo <luoyonggang@gmail.com>
* common.h: Remove ar.h, byteswap.h and endian.h.
: bswap_64 (Var))))
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
# define MY_ELFDATA ELFDATA2LSB
#else
# define MY_ELFDATA ELFDATA2MSB
is the same. */
ident = elf->state.ELFW(elf,LIBELFBITS).ehdr->e_ident;
same_byte_order = ((ident[EI_DATA] == ELFDATA2LSB
- && __BYTE_ORDER == __LITTLE_ENDIAN)
+ && BYTE_ORDER == LITTLE_ENDIAN)
|| (ident[EI_DATA] == ELFDATA2MSB
- && __BYTE_ORDER == __BIG_ENDIAN));
+ && BYTE_ORDER == BIG_ENDIAN));
/* If we don't have native byte order, we will likely need to
convert the data with xlate functions. We do it upfront instead
and vice versa since the function only has to copy and/or
change the byte order.
*/
- if ((__BYTE_ORDER == __LITTLE_ENDIAN && encode == ELFDATA2LSB)
- || (__BYTE_ORDER == __BIG_ENDIAN && encode == ELFDATA2MSB))
+ if ((BYTE_ORDER == LITTLE_ENDIAN && encode == ELFDATA2LSB)
+ || (BYTE_ORDER == BIG_ENDIAN && encode == ELFDATA2MSB))
{
/* We simply have to copy since the byte order is the same. */
if (src->d_buf != dest->d_buf)
*offp += w;
- if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ if (BYTE_ORDER == LITTLE_ENDIAN)
*nump = index64_p ? bswap_64 (u.ret64) : bswap_32 (u.ret32);
else
*nump = index64_p ? u.ret64 : u.ret32;
if (index64_p)
{
uint64_t tmp = (*u64)[cnt];
- if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ if (BYTE_ORDER == LITTLE_ENDIAN)
tmp = bswap_64 (tmp);
arsym[cnt].as_off = tmp;
goto out;
}
}
- else if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ else if (BYTE_ORDER == LITTLE_ENDIAN)
arsym[cnt].as_off = bswap_32 ((*u32)[cnt]);
else
arsym[cnt].as_off = (*u32)[cnt];
+2022-09-20 Yonggang Luo <luoyonggang@gmail.com>
+
+ * arlib.h: Use BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN.
+
2022-08-28 Mark Wielaard <mark@klomp.org>
* ar.c (do_oper_extract): Predecrement instance before compare
#define AR_HDR_WORDS (sizeof (struct ar_hdr) / sizeof (uint32_t))
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
# define le_bswap_32(val) bswap_32 (val)
#else
# define le_bswap_32(val) (val)