svn commit: r275517 - in stable/9/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common
Mark Johnston
markj at FreeBSD.org
Fri Dec 5 18:55:33 UTC 2014
Author: markj
Date: Fri Dec 5 18:55:32 2014
New Revision: 275517
URL: https://svnweb.freebsd.org/changeset/base/275517
Log:
MFC r271695:
Fix some incorrect endianness checks.
Modified:
stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
Directory Properties:
stable/9/cddl/contrib/opensolaris/ (props changed)
stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed)
Modified: stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:31 2014 (r275516)
+++ stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:32 2014 (r275517)
@@ -273,7 +273,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;
Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:31 2014 (r275516)
+++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:32 2014 (r275517)
@@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong
* 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
* Offsets are counted from opposite ends on little- and
* big-endian machines.
*/
-#ifdef _BIG_ENDIAN
+#if BYTE_ORDER == _BIG_ENDIAN
shift = NBBY - shift;
#endif
More information about the svn-src-stable-9
mailing list