212-x86_reloc_portability.patch 463 B

12345678910111213141516171819202122
  1. --- a/arch/x86/tools/relocs.c
  2. +++ b/arch/x86/tools/relocs.c
  3. @@ -10,7 +10,18 @@
  4. #define USE_BSD
  5. #include <endian.h>
  6. #include <regex.h>
  7. -#include <tools/le_byteshift.h>
  8. +
  9. +static inline void __put_unaligned_le16(uint16_t val, uint8_t *p)
  10. +{
  11. + *p++ = val;
  12. + *p++ = val >> 8;
  13. +}
  14. +
  15. +static inline void put_unaligned_le32(uint32_t val, uint8_t *p)
  16. +{
  17. + __put_unaligned_le16(val >> 16, p + 2);
  18. + __put_unaligned_le16(val, p);
  19. +}
  20. static void die(char *fmt, ...);