diff options
author | Marcus Comstedt <marcus@mc.pp.se> | 2019-08-02 19:45:15 +0200 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2019-08-15 13:42:28 +0800 |
commit | e604410d3eafc77e1b9a7fbb0580a23e528f0037 (patch) | |
tree | d7c21bba43f08632871ff0978eed7cbba46f5a73 /tools/prelink-riscv.c | |
parent | 88af42d3deed0fa705706b134cc50485f3bddcef (diff) | |
download | u-boot-e604410d3eafc77e1b9a7fbb0580a23e528f0037.tar.gz |
riscv: tools: Fix prelink-riscv to work on big endian hosts
All ELF fields whose values are inspected by the code are converted to
CPU byteorder first. Values which are copied verbatim (relocation
fixups) are not swapped to CPU byteorder and back as it is not needed.
Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>
Cc: Rick Chen <rick@andestech.com>
Reviewed-by: Rick Chen <rick@andestech.com>
Diffstat (limited to 'tools/prelink-riscv.c')
-rw-r--r-- | tools/prelink-riscv.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/prelink-riscv.c b/tools/prelink-riscv.c index 52eb78e9d0..a900a1497a 100644 --- a/tools/prelink-riscv.c +++ b/tools/prelink-riscv.c @@ -8,10 +8,6 @@ * without fixup. Both RV32 and RV64 are supported. */ -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ -#error "Only little-endian host is supported" -#endif - #include <errno.h> #include <stdbool.h> #include <stdint.h> @@ -25,6 +21,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> +#include <compiler.h> #ifndef EM_RISCV #define EM_RISCV 243 |