diff options
Diffstat (limited to 'utils/readsoname2.c')
-rw-r--r-- | utils/readsoname2.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/utils/readsoname2.c b/utils/readsoname2.c index 6a9f00775..a74b46aa1 100644 --- a/utils/readsoname2.c +++ b/utils/readsoname2.c @@ -35,13 +35,11 @@ char *readsonameXX(char *name, FILE *infile, int expected_type, int *type) if ((char *)(epnt + 1) > (char *)(header + st.st_size)) goto skip; -#if __BYTE_ORDER == __LITTLE_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; -#elif __BYTE_ORDER == __BIG_ENDIAN - byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; -#else -#error Unknown host byte order! -#endif + if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) + byteswap = (epnt->e_ident[5] == ELFDATA2MSB) ? 1 : 0; + else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) + byteswap = (epnt->e_ident[5] == ELFDATA2LSB) ? 1 : 0; + /* Be very lazy, and only byteswap the stuff we use */ if (byteswap == 1) { epnt->e_phoff = bswap_32(epnt->e_phoff); |