Fix some incorrect endianness checks.
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
65bccd5b54
commit
1642671ec5
cddl/contrib/opensolaris/lib
@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp)
|
||||
*/
|
||||
if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) &&
|
||||
bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) {
|
||||
#ifdef _BIG_ENDIAN
|
||||
#if BYTE_ORDER == _BIG_ENDIAN
|
||||
uchar_t order = ELFDATA2MSB;
|
||||
#else
|
||||
uchar_t order = ELFDATA2LSB;
|
||||
|
@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong_t off, ctf_encoding_t *ep)
|
||||
* to the lowest 'size' bytes in 'value', and we need to shift based on
|
||||
* the offset from the end of the data, not the offset of the start.
|
||||
*/
|
||||
#ifdef _BIG_ENDIAN
|
||||
#if BYTE_ORDER == _BIG_ENDIAN
|
||||
buf += sizeof (value) - size;
|
||||
off += ep->cte_bits;
|
||||
#endif
|
||||
@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong_t off, ctf_encoding_t *ep)
|
||||
* Offsets are counted from opposite ends on little- and
|
||||
* big-endian machines.
|
||||
*/
|
||||
#ifdef _BIG_ENDIAN
|
||||
#if BYTE_ORDER == _BIG_ENDIAN
|
||||
shift = NBBY - shift;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user