host-aout.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* BFD backend for local host's a.out binaries
  2. Copyright (C) 1990-2022 Free Software Foundation, Inc.
  3. Written by Cygnus Support. Probably John Gilmore's fault.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #include "sysdep.h"
  18. #include "bfd.h"
  19. #include "libbfd.h"
  20. #define ARCH_SIZE 32
  21. /* When porting to a new system, you must supply:
  22. HOST_PAGE_SIZE (optional)
  23. HOST_SEGMENT_SIZE (optional -- defaults to page size)
  24. HOST_MACHINE_ARCH (optional)
  25. HOST_MACHINE_MACHINE (optional)
  26. HOST_TEXT_START_ADDR (optional)
  27. HOST_STACK_END_ADDR (not used, except by trad-core ???)
  28. HOST_BIG_ENDIAN_P (required -- define if big-endian)
  29. in the ./hosts/h-systemname.h file. */
  30. #ifdef TRAD_HEADER
  31. #include TRAD_HEADER
  32. #endif
  33. #ifdef HOST_PAGE_SIZE
  34. #define TARGET_PAGE_SIZE HOST_PAGE_SIZE
  35. #endif
  36. #ifdef HOST_SEGMENT_SIZE
  37. #define SEGMENT_SIZE HOST_SEGMENT_SIZE
  38. #else
  39. #define SEGMENT_SIZE TARGET_PAGE_SIZE
  40. #endif
  41. #ifdef HOST_TEXT_START_ADDR
  42. #define TEXT_START_ADDR HOST_TEXT_START_ADDR
  43. #endif
  44. #ifdef HOST_STACK_END_ADDR
  45. #define STACK_END_ADDR HOST_STACK_END_ADDR
  46. #endif
  47. #ifdef HOST_BIG_ENDIAN_P
  48. #define TARGET_IS_BIG_ENDIAN_P
  49. #else
  50. #undef TARGET_IS_BIG_ENDIAN_P
  51. #endif
  52. #include "libaout.h" /* BFD a.out internal data structures */
  53. #include "aout/aout64.h"
  54. #ifdef HOST_MACHINE_ARCH
  55. #ifdef HOST_MACHINE_MACHINE
  56. #define SET_ARCH_MACH(abfd, execp) \
  57. bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, HOST_MACHINE_MACHINE)
  58. #else
  59. #define SET_ARCH_MACH(abfd, execp) \
  60. bfd_default_set_arch_mach(abfd, HOST_MACHINE_ARCH, 0)
  61. #endif
  62. #endif /* HOST_MACHINE_ARCH */
  63. /* Do not "beautify" the CONCAT* macro args. Traditional C will not
  64. remove whitespace added here, and thus will fail to concatenate
  65. the tokens. */
  66. #define MY(OP) CONCAT2 (host_aout_,OP)
  67. #define TARGETNAME "a.out"
  68. #include "aout-target.h"