hex2.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*- c-file-style: "linux";indent-tabs-mode:t -*- */
  2. /* Copyright (C) 2017 Jeremiah Orians
  3. * Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org>
  4. * This file is part of mescc-tools
  5. *
  6. * mescc-tools is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * mescc-tools is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with mescc-tools. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <unistd.h>
  23. #include <sys/stat.h>
  24. #include "M2libc/bootstrappable.h"
  25. #define max_string 4096
  26. #define TRUE 1
  27. #define FALSE 0
  28. #define KNIGHT 0
  29. #define X86 0x03
  30. #define AMD64 0x3E
  31. #define ARMV7L 0x28
  32. #define AARM64 0xB7
  33. #define PPC64LE 0x15
  34. #define RISCV32 0xF3
  35. #define RISCV64 0x100F3 /* Because RISC-V unlike all other architectures does get a seperate e_machine when changing from 32 to 64bit */
  36. #define HEX 16
  37. #define OCTAL 8
  38. #define BINARY 2
  39. struct input_files
  40. {
  41. struct input_files* next;
  42. char* filename;
  43. };
  44. struct entry
  45. {
  46. struct entry* next;
  47. unsigned target;
  48. char* name;
  49. };