i386.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* coff information for Intel 386/486.
  2. Copyright (C) 2001-2015 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  14. MA 02110-1301, USA. */
  15. #define L_LNNO_SIZE 2
  16. #define INCLUDE_COMDAT_FIELDS_IN_AUXENT
  17. #include "coff/external.h"
  18. #define COFF_PAGE_SIZE 0x1000
  19. /* Bits for f_flags:
  20. F_RELFLG Relocation info stripped from file
  21. F_EXEC File is executable (no unresolved external references)
  22. F_LNNO Line numbers stripped from file
  23. F_LSYMS Local symbols stripped from file
  24. F_AR32WR File has byte ordering of an AR32WR machine (e.g. vax). */
  25. #define F_RELFLG (0x0001)
  26. #define F_EXEC (0x0002)
  27. #define F_LNNO (0x0004)
  28. #define F_LSYMS (0x0008)
  29. #define I386MAGIC 0x14c
  30. #define I386PTXMAGIC 0x154
  31. #define I386AIXMAGIC 0x175
  32. /* This is Lynx's all-platform magic number for executables. */
  33. #define LYNXCOFFMAGIC 0415
  34. #define I386BADMAG(x) ( ((x).f_magic != I386MAGIC) \
  35. && (x).f_magic != I386AIXMAGIC \
  36. && (x).f_magic != I386PTXMAGIC \
  37. && (x).f_magic != LYNXCOFFMAGIC)
  38. #define OMAGIC 0404 /* Object files, eg as output. */
  39. #define ZMAGIC 0413 /* Demand load format, eg normal ld output. */
  40. #define STMAGIC 0401 /* Target shlib. */
  41. #define SHMAGIC 0443 /* Host shlib. */
  42. /* Define some NT default values. */
  43. /* #define NT_IMAGE_BASE 0x400000 moved to internal.h */
  44. #define NT_SECTION_ALIGNMENT 0x1000
  45. #define NT_FILE_ALIGNMENT 0x200
  46. #define NT_DEF_RESERVE 0x100000
  47. #define NT_DEF_COMMIT 0x1000
  48. /* Relocation directives. */
  49. struct external_reloc
  50. {
  51. char r_vaddr[4];
  52. char r_symndx[4];
  53. char r_type[2];
  54. };
  55. #define RELOC struct external_reloc
  56. #define RELSZ 10