relocs.h 826 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef RELOCS_H
  3. #define RELOCS_H
  4. #include <stdio.h>
  5. #include <stdarg.h>
  6. #include <stdlib.h>
  7. #include <stdint.h>
  8. #include <inttypes.h>
  9. #include <string.h>
  10. #include <errno.h>
  11. #include <unistd.h>
  12. #include <elf.h>
  13. #include <byteswap.h>
  14. #define USE_BSD
  15. #include <endian.h>
  16. #include <regex.h>
  17. void die(char *fmt, ...);
  18. /*
  19. * Introduced for MIPSr6
  20. */
  21. #ifndef R_MIPS_PC21_S2
  22. #define R_MIPS_PC21_S2 60
  23. #endif
  24. #ifndef R_MIPS_PC26_S2
  25. #define R_MIPS_PC26_S2 61
  26. #endif
  27. #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
  28. enum symtype {
  29. S_ABS,
  30. S_REL,
  31. S_SEG,
  32. S_LIN,
  33. S_NSYMTYPES
  34. };
  35. void process_32(FILE *fp, int as_text, int as_bin,
  36. int show_reloc_info, int keep_relocs);
  37. void process_64(FILE *fp, int as_text, int as_bin,
  38. int show_reloc_info, int keep_relocs);
  39. #endif /* RELOCS_H */