summaryrefslogtreecommitdiff
path: root/kmodloader.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-08-30 15:23:58 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-08-30 19:12:51 +0200
commit9cb63df9b905e735c718d582b1d65cdff383cbd3 (patch)
treea091e38530460dc87cda3cb996e1a313e5f8658c /kmodloader.c
parent2cff779140b7b10256d722c9267f8a38c9fba088 (diff)
downloadubox-9cb63df9b905e735c718d582b1d65cdff383cbd3.tar.gz
kmodloader: fix endianess check
Use __BYTE_ORDER macro to check system endianess as the macro's __LITTLE_ENDIAN, __BIG_ENDIAN are defined irrespective of the sytem endianess leading to an endianess check failure on big endian systems. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> Acked-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'kmodloader.c')
-rw-r--r--kmodloader.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kmodloader.c b/kmodloader.c
index a6aa795..a4d492d 100644
--- a/kmodloader.c
+++ b/kmodloader.c
@@ -216,9 +216,9 @@ static int elf_find_section(char *map, const char *section, unsigned int *offset
int clazz = map[EI_CLASS];
int endian = map[EI_DATA];
-#if defined(__LITTLE_ENDIAN)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
if (endian != ELFDATA2LSB)
-#elif defined(__BIG_ENDIAN)
+#elif __BYTE_ORDER == __BIG_ENDIAN
if (endian != ELFDATA2MSB)
#else
#error "unsupported endian"