2
0

elf.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _BITS_ELF_H
  2. #define _BITS_ELF_H
  3. #define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
  4. #define ELF32_ST_TYPE(val) ((val) & 0xf)
  5. #define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
  6. #define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
  7. #define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
  8. #define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
  9. #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
  10. #define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
  11. #define ELF32_R_SYM(val) ((val) >> 8)
  12. #define ELF32_R_TYPE(val) ((val) & 0xff)
  13. #define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
  14. #define ELF64_R_SYM(i) ((i) >> 32)
  15. #define ELF64_R_TYPE(i) ((i) & 0xffffffff)
  16. #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
  17. #define DT_VALRNGHI 0x6ffffdff
  18. #define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
  19. #define DT_ADDRRNGHI 0x6ffffeff
  20. #define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
  21. #define DT_VERNEEDNUM 0x6fffffff
  22. #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
  23. #define ELF32_M_SYM(info) ((info) >> 8)
  24. #define ELF32_M_SIZE(info) ((unsigned char) (info))
  25. #define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
  26. #define ELF64_M_SYM(info) ELF32_M_SYM (info)
  27. #define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
  28. #define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
  29. #endif /* ifdef _BITS_ELF_H*/