pei-aarch64.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* BFD back-end for AArch64 PE IMAGE COFF files.
  2. Copyright (C) 2021-2022 Free Software Foundation, Inc.
  3. This file is part of BFD, the Binary File Descriptor library.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. #include "sysdep.h"
  17. #include "bfd.h"
  18. #define TARGET_SYM aarch64_pei_vec
  19. #define TARGET_NAME "pei-aarch64-little"
  20. #define TARGET_ARCHITECTURE bfd_arch_aarch64
  21. #define TARGET_PAGESIZE 4096
  22. #define TARGET_BIG_ENDIAN 0
  23. #define TARGET_ARCHIVE 0
  24. #define TARGET_PRIORITY 0
  25. #define COFF_IMAGE_WITH_PE
  26. /* Rename the above into.. */
  27. #define COFF_WITH_peAArch64
  28. #define COFF_WITH_PE
  29. #define PCRELOFFSET true
  30. /* Long section names not allowed in executable images, only object files. */
  31. #define COFF_LONG_SECTION_NAMES 0
  32. #define COFF_SECTION_ALIGNMENT_ENTRIES \
  33. { COFF_SECTION_NAME_EXACT_MATCH (".bss"), \
  34. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  35. { COFF_SECTION_NAME_EXACT_MATCH (".data"), \
  36. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  37. { COFF_SECTION_NAME_EXACT_MATCH (".rdata"), \
  38. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  39. { COFF_SECTION_NAME_EXACT_MATCH (".text"), \
  40. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  41. { COFF_SECTION_NAME_PARTIAL_MATCH (".idata"), \
  42. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  43. { COFF_SECTION_NAME_EXACT_MATCH (".pdata"), \
  44. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 2 }, \
  45. { COFF_SECTION_NAME_PARTIAL_MATCH (".debug"), \
  46. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }, \
  47. { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.wi."), \
  48. COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 0 }
  49. #define PEI_HEADERS
  50. #include "sysdep.h"
  51. #include "bfd.h"
  52. #include "libbfd.h"
  53. #include "coff/aarch64.h"
  54. #include "coff/internal.h"
  55. #include "coff/pe.h"
  56. #include "libcoff.h"
  57. #include "libpei.h"
  58. #include "libiberty.h"
  59. /* Make sure we're setting a 64-bit format. */
  60. #undef AOUTSZ
  61. #define AOUTSZ PEPAOUTSZ
  62. #define PEAOUTHDR PEPAOUTHDR
  63. #include "coff-aarch64.c"