mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
b69c9d41e8
This adds support for efi-*-aarch64 by virtue of adding a new PEI target pei-aarch64-little. This is not a full target and only exists to support EFI at this time. This means that this target does not support relocation processing and is mostly a container format. This format has been added to elf based aarch64 targets such that efi images can be made natively on Linux. However this target is not valid for use with gas but only with objcopy. With these changes the resulting file is recognized as an efi image by third party tools: > pecli info hello.efi Metadata ================================================================================ MD5: 598c32a778b0f0deebe977fef8578c4e SHA1: 4580121edd5cb4dc40f51b28f171fd15250df84c SHA256: 3154bd7cf42433d1c957f6bf55a17ad8c57ed41b29df2d485703349fd6ff1d5c Imphash: Size: 47561 bytes Type: PE32+ executable (EFI application) (stripped to external PDB), for MS Windows Compile Time: 1970-01-01 00:00:00 (UTC - 0x0 ) Entry point: 0x2000 (section .text) Sections ================================================================================ Name RWX VirtSize VirtAddr RawAddr RawSize Entropy md5 .text R-X 0x5bb0 0x2000 0x400 0x5c00 6.39 551fbc264256a3f387de8a891500ae0d .reloc R-- 0xc 0x8000 0x6000 0x200 0.02 0c45f6d812d079821c1d54c09ab89e1d .data RW- 0x1d88 0x9000 0x6200 0x1e00 4.18 5d1137c09f01289dc62bf754f7290db3 .dynamic RW- 0xf0 0xb000 0x8000 0x200 0.34 5c94ed3206f05a277e6f04fbf131f131 .rela R-- 0xe58 0xc000 0x8200 0x1000 1.87 8b5c6bc30f3acb7ca7bf2e6789d68519 .dynsym R-- 0x138 0xd000 0x9200 0x200 0.96 bdcf5101da51aadc663ca8859f88138c Imports ================================================================================ Any magic number is based on the Microsoft PE specification [1]. [1] https://docs.microsoft.com/en-us/windows/win32/debug/pe-format bfd/ChangeLog: 2021-10-21 Tamar Christina <tamar.christina@arm.com> PR binutils/26206 * .gitignore (pe-aarch64igen.c): New. * Makefile.am (pei-aarch64.lo, pe-aarch64igen.lo, pei-aarch64.c, pe-aarch64igen.c): Add support. * Makefile.in: Likewise. * bfd.c (bfd_get_sign_extend_vma): Add pei-aarch64-little. * coff-aarch64.c: New file. * coffcode.h (coff_set_arch_mach_hook, coff_set_flags, coff_write_object_contents) Add aarch64 (aarch64_pei_vec) support. * config.bfd: Likewise. * configure: Likewise. * configure.ac: Likewise. * libpei.h (GET_OPTHDR_IMAGE_BASE, PUT_OPTHDR_IMAGE_BASE, GET_OPTHDR_SIZE_OF_STACK_RESERVE, PUT_OPTHDR_SIZE_OF_STACK_RESERVE, GET_OPTHDR_SIZE_OF_STACK_COMMIT, PUT_OPTHDR_SIZE_OF_STACK_COMMIT, GET_OPTHDR_SIZE_OF_HEAP_RESERVE, PUT_OPTHDR_SIZE_OF_HEAP_RESERVE, GET_OPTHDR_SIZE_OF_HEAP_COMMIT, PUT_OPTHDR_SIZE_OF_HEAP_COMMIT, GET_PDATA_ENTRY, _bfd_peAArch64_bfd_copy_private_bfd_data_common, _bfd_peAArch64_bfd_copy_private_section_data, _bfd_peAArch64_get_symbol_info, _bfd_peAArch64_only_swap_filehdr_out, _bfd_peAArch64_print_private_bfd_data_common, _bfd_peAArch64i_final_link_postscript, _bfd_peAArch64i_only_swap_filehdr_out, _bfd_peAArch64i_swap_aouthdr_in, _bfd_peAArch64i_swap_aouthdr_out, _bfd_peAArch64i_swap_aux_in, _bfd_peAArch64i_swap_aux_out, _bfd_peAArch64i_swap_lineno_in, _bfd_peAArch64i_swap_lineno_out, _bfd_peAArch64i_swap_scnhdr_out, _bfd_peAArch64i_swap_sym_in, _bfd_peAArch64i_swap_sym_out, _bfd_peAArch64i_swap_debugdir_in, _bfd_peAArch64i_swap_debugdir_out, _bfd_peAArch64i_write_codeview_record, _bfd_peAArch64i_slurp_codeview_record, _bfd_peAArch64_print_ce_compressed_pdata): New. * peXXigen.c (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out, pe_print_pdata, _bfd_XX_print_private_bfd_data_common, _bfd_XX_bfd_copy_private_section_data, _bfd_XXi_final_link_postscript): Support COFF_WITH_peAArch64, * pei-aarch64.c: New file. * peicode.h (coff_swap_scnhdr_in, pe_ILF_build_a_bfd, pe_ILF_object_p): Support COFF_WITH_peAArch64. (jtab): Add dummy entry that traps. * targets.c (aarch64_pei_vec): New. binutils/ChangeLog: 2021-10-21 Tamar Christina <tamar.christina@arm.com> PR binutils/26206 * NEWS: Add new support. * objcopy.c (convert_efi_target): Add efi-*-aarch64 support. * testsuite/binutils-all/aarch64/pei-aarch64-little.d: New test. * testsuite/binutils-all/aarch64/pei-aarch64-little.s: New test. include/ChangeLog: 2021-10-21 Tamar Christina <tamar.christina@arm.com> PR binutils/26206 * coff/aarch64.h: New file. * coff/pe.h (IMAGE_FILE_MACHINE_ARM64): New.
410 lines
16 KiB
C
410 lines
16 KiB
C
/* Support for the generic parts of PE/PEI; common header information.
|
|
Copyright (C) 1995-2021 Free Software Foundation, Inc.
|
|
Written by Cygnus Solutions.
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
|
MA 02110-1301, USA. */
|
|
|
|
|
|
/* Most of this hacked by Steve Chamberlain,
|
|
sac@cygnus.com
|
|
|
|
PE/PEI rearrangement (and code added): Donn Terry
|
|
Softway Systems, Inc. */
|
|
|
|
/* Hey look, some documentation [and in a place you expect to find it]!
|
|
|
|
The main reference for the pei format is "Microsoft Portable Executable
|
|
and Common Object File Format Specification 4.1". Get it if you need to
|
|
do some serious hacking on this code.
|
|
|
|
Another reference:
|
|
"Peering Inside the PE: A Tour of the Win32 Portable Executable
|
|
File Format", MSJ 1994, Volume 9.
|
|
|
|
The *sole* difference between the pe format and the pei format is that the
|
|
latter has an MSDOS 2.0 .exe header on the front that prints the message
|
|
"This app must be run under Windows." (or some such).
|
|
(FIXME: Whether that statement is *really* true or not is unknown.
|
|
Are there more subtle differences between pe and pei formats?
|
|
For now assume there aren't. If you find one, then for God sakes
|
|
document it here!)
|
|
|
|
The Microsoft docs use the word "image" instead of "executable" because
|
|
the former can also refer to a DLL (shared library). Confusion can arise
|
|
because the `i' in `pei' also refers to "image". The `pe' format can
|
|
also create images (i.e. executables), it's just that to run on a win32
|
|
system you need to use the pei format.
|
|
|
|
FIXME: Please add more docs here so the next poor fool that has to hack
|
|
on this code has a chance of getting something accomplished without
|
|
wasting too much time. */
|
|
|
|
#ifndef GET_FCN_LNNOPTR
|
|
#define GET_FCN_LNNOPTR(abfd, ext) \
|
|
H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
|
|
#endif
|
|
|
|
#ifndef GET_FCN_ENDNDX
|
|
#define GET_FCN_ENDNDX(abfd, ext) \
|
|
H_GET_32 (abfd, ext->x_sym.x_fcnary.x_fcn.x_endndx)
|
|
#endif
|
|
|
|
#ifndef PUT_FCN_LNNOPTR
|
|
#define PUT_FCN_LNNOPTR(abfd, in, ext) \
|
|
H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_lnnoptr)
|
|
#endif
|
|
#ifndef PUT_FCN_ENDNDX
|
|
#define PUT_FCN_ENDNDX(abfd, in, ext) \
|
|
H_PUT_32(abfd, in, ext->x_sym.x_fcnary.x_fcn.x_endndx)
|
|
#endif
|
|
#ifndef GET_LNSZ_LNNO
|
|
#define GET_LNSZ_LNNO(abfd, ext) \
|
|
H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_lnno)
|
|
#endif
|
|
#ifndef GET_LNSZ_SIZE
|
|
#define GET_LNSZ_SIZE(abfd, ext) \
|
|
H_GET_16 (abfd, ext->x_sym.x_misc.x_lnsz.x_size)
|
|
#endif
|
|
#ifndef PUT_LNSZ_LNNO
|
|
#define PUT_LNSZ_LNNO(abfd, in, ext) \
|
|
H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_lnno)
|
|
#endif
|
|
#ifndef PUT_LNSZ_SIZE
|
|
#define PUT_LNSZ_SIZE(abfd, in, ext) \
|
|
H_PUT_16(abfd, in, ext->x_sym.x_misc.x_lnsz.x_size)
|
|
#endif
|
|
#ifndef GET_SCN_SCNLEN
|
|
#define GET_SCN_SCNLEN(abfd, ext) \
|
|
H_GET_32 (abfd, ext->x_scn.x_scnlen)
|
|
#endif
|
|
#ifndef GET_SCN_NRELOC
|
|
#define GET_SCN_NRELOC(abfd, ext) \
|
|
H_GET_16 (abfd, ext->x_scn.x_nreloc)
|
|
#endif
|
|
#ifndef GET_SCN_NLINNO
|
|
#define GET_SCN_NLINNO(abfd, ext) \
|
|
H_GET_16 (abfd, ext->x_scn.x_nlinno)
|
|
#endif
|
|
#ifndef PUT_SCN_SCNLEN
|
|
#define PUT_SCN_SCNLEN(abfd, in, ext) \
|
|
H_PUT_32(abfd, in, ext->x_scn.x_scnlen)
|
|
#endif
|
|
#ifndef PUT_SCN_NRELOC
|
|
#define PUT_SCN_NRELOC(abfd, in, ext) \
|
|
H_PUT_16(abfd, in, ext->x_scn.x_nreloc)
|
|
#endif
|
|
#ifndef PUT_SCN_NLINNO
|
|
#define PUT_SCN_NLINNO(abfd, in, ext) \
|
|
H_PUT_16(abfd,in, ext->x_scn.x_nlinno)
|
|
#endif
|
|
#ifndef GET_LINENO_LNNO
|
|
#define GET_LINENO_LNNO(abfd, ext) \
|
|
H_GET_16 (abfd, ext->l_lnno);
|
|
#endif
|
|
#ifndef PUT_LINENO_LNNO
|
|
#define PUT_LINENO_LNNO(abfd, val, ext) \
|
|
H_PUT_16(abfd,val, ext->l_lnno);
|
|
#endif
|
|
|
|
/* The f_symptr field in the filehdr is sometimes 64 bits. */
|
|
#ifndef GET_FILEHDR_SYMPTR
|
|
#define GET_FILEHDR_SYMPTR H_GET_32
|
|
#endif
|
|
#ifndef PUT_FILEHDR_SYMPTR
|
|
#define PUT_FILEHDR_SYMPTR H_PUT_32
|
|
#endif
|
|
|
|
/* Some fields in the aouthdr are sometimes 64 bits. */
|
|
#ifndef GET_AOUTHDR_TSIZE
|
|
#define GET_AOUTHDR_TSIZE H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_TSIZE
|
|
#define PUT_AOUTHDR_TSIZE H_PUT_32
|
|
#endif
|
|
#ifndef GET_AOUTHDR_DSIZE
|
|
#define GET_AOUTHDR_DSIZE H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_DSIZE
|
|
#define PUT_AOUTHDR_DSIZE H_PUT_32
|
|
#endif
|
|
#ifndef GET_AOUTHDR_BSIZE
|
|
#define GET_AOUTHDR_BSIZE H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_BSIZE
|
|
#define PUT_AOUTHDR_BSIZE H_PUT_32
|
|
#endif
|
|
#ifndef GET_AOUTHDR_ENTRY
|
|
#define GET_AOUTHDR_ENTRY H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_ENTRY
|
|
#define PUT_AOUTHDR_ENTRY H_PUT_32
|
|
#endif
|
|
#ifndef GET_AOUTHDR_TEXT_START
|
|
#define GET_AOUTHDR_TEXT_START H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_TEXT_START
|
|
#define PUT_AOUTHDR_TEXT_START H_PUT_32
|
|
#endif
|
|
#ifndef GET_AOUTHDR_DATA_START
|
|
#define GET_AOUTHDR_DATA_START H_GET_32
|
|
#endif
|
|
#ifndef PUT_AOUTHDR_DATA_START
|
|
#define PUT_AOUTHDR_DATA_START H_PUT_32
|
|
#endif
|
|
|
|
/* Some fields in the scnhdr are sometimes 64 bits. */
|
|
#ifndef GET_SCNHDR_PADDR
|
|
#define GET_SCNHDR_PADDR H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_PADDR
|
|
#define PUT_SCNHDR_PADDR H_PUT_32
|
|
#endif
|
|
#ifndef GET_SCNHDR_VADDR
|
|
#define GET_SCNHDR_VADDR H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_VADDR
|
|
#define PUT_SCNHDR_VADDR H_PUT_32
|
|
#endif
|
|
#ifndef GET_SCNHDR_SIZE
|
|
#define GET_SCNHDR_SIZE H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_SIZE
|
|
#define PUT_SCNHDR_SIZE H_PUT_32
|
|
#endif
|
|
#ifndef GET_SCNHDR_SCNPTR
|
|
#define GET_SCNHDR_SCNPTR H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_SCNPTR
|
|
#define PUT_SCNHDR_SCNPTR H_PUT_32
|
|
#endif
|
|
#ifndef GET_SCNHDR_RELPTR
|
|
#define GET_SCNHDR_RELPTR H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_RELPTR
|
|
#define PUT_SCNHDR_RELPTR H_PUT_32
|
|
#endif
|
|
#ifndef GET_SCNHDR_LNNOPTR
|
|
#define GET_SCNHDR_LNNOPTR H_GET_32
|
|
#endif
|
|
#ifndef PUT_SCNHDR_LNNOPTR
|
|
#define PUT_SCNHDR_LNNOPTR H_PUT_32
|
|
#endif
|
|
|
|
#ifdef COFF_WITH_pex64
|
|
|
|
#define GET_OPTHDR_IMAGE_BASE H_GET_64
|
|
#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
|
|
#define GET_PDATA_ENTRY bfd_get_32
|
|
|
|
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pex64_bfd_copy_private_bfd_data_common
|
|
#define _bfd_XX_bfd_copy_private_section_data _bfd_pex64_bfd_copy_private_section_data
|
|
#define _bfd_XX_get_symbol_info _bfd_pex64_get_symbol_info
|
|
#define _bfd_XX_only_swap_filehdr_out _bfd_pex64_only_swap_filehdr_out
|
|
#define _bfd_XX_print_private_bfd_data_common _bfd_pex64_print_private_bfd_data_common
|
|
#define _bfd_XXi_final_link_postscript _bfd_pex64i_final_link_postscript
|
|
#define _bfd_XXi_only_swap_filehdr_out _bfd_pex64i_only_swap_filehdr_out
|
|
#define _bfd_XXi_swap_aouthdr_in _bfd_pex64i_swap_aouthdr_in
|
|
#define _bfd_XXi_swap_aouthdr_out _bfd_pex64i_swap_aouthdr_out
|
|
#define _bfd_XXi_swap_aux_in _bfd_pex64i_swap_aux_in
|
|
#define _bfd_XXi_swap_aux_out _bfd_pex64i_swap_aux_out
|
|
#define _bfd_XXi_swap_lineno_in _bfd_pex64i_swap_lineno_in
|
|
#define _bfd_XXi_swap_lineno_out _bfd_pex64i_swap_lineno_out
|
|
#define _bfd_XXi_swap_scnhdr_out _bfd_pex64i_swap_scnhdr_out
|
|
#define _bfd_XXi_swap_sym_in _bfd_pex64i_swap_sym_in
|
|
#define _bfd_XXi_swap_sym_out _bfd_pex64i_swap_sym_out
|
|
#define _bfd_XXi_swap_debugdir_in _bfd_pex64i_swap_debugdir_in
|
|
#define _bfd_XXi_swap_debugdir_out _bfd_pex64i_swap_debugdir_out
|
|
#define _bfd_XXi_write_codeview_record _bfd_pex64i_write_codeview_record
|
|
#define _bfd_XXi_slurp_codeview_record _bfd_pex64i_slurp_codeview_record
|
|
|
|
#elif defined COFF_WITH_pep
|
|
|
|
#define GET_OPTHDR_IMAGE_BASE H_GET_64
|
|
#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
|
|
#define GET_PDATA_ENTRY bfd_get_64
|
|
|
|
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pep_bfd_copy_private_bfd_data_common
|
|
#define _bfd_XX_bfd_copy_private_section_data _bfd_pep_bfd_copy_private_section_data
|
|
#define _bfd_XX_get_symbol_info _bfd_pep_get_symbol_info
|
|
#define _bfd_XX_only_swap_filehdr_out _bfd_pep_only_swap_filehdr_out
|
|
#define _bfd_XX_print_private_bfd_data_common _bfd_pep_print_private_bfd_data_common
|
|
#define _bfd_XXi_final_link_postscript _bfd_pepi_final_link_postscript
|
|
#define _bfd_XXi_only_swap_filehdr_out _bfd_pepi_only_swap_filehdr_out
|
|
#define _bfd_XXi_swap_aouthdr_in _bfd_pepi_swap_aouthdr_in
|
|
#define _bfd_XXi_swap_aouthdr_out _bfd_pepi_swap_aouthdr_out
|
|
#define _bfd_XXi_swap_aux_in _bfd_pepi_swap_aux_in
|
|
#define _bfd_XXi_swap_aux_out _bfd_pepi_swap_aux_out
|
|
#define _bfd_XXi_swap_lineno_in _bfd_pepi_swap_lineno_in
|
|
#define _bfd_XXi_swap_lineno_out _bfd_pepi_swap_lineno_out
|
|
#define _bfd_XXi_swap_scnhdr_out _bfd_pepi_swap_scnhdr_out
|
|
#define _bfd_XXi_swap_sym_in _bfd_pepi_swap_sym_in
|
|
#define _bfd_XXi_swap_sym_out _bfd_pepi_swap_sym_out
|
|
#define _bfd_XXi_swap_debugdir_in _bfd_pepi_swap_debugdir_in
|
|
#define _bfd_XXi_swap_debugdir_out _bfd_pepi_swap_debugdir_out
|
|
#define _bfd_XXi_write_codeview_record _bfd_pepi_write_codeview_record
|
|
#define _bfd_XXi_slurp_codeview_record _bfd_pepi_slurp_codeview_record
|
|
|
|
#elif defined COFF_WITH_peAArch64
|
|
|
|
#define GET_OPTHDR_IMAGE_BASE H_GET_64
|
|
#define PUT_OPTHDR_IMAGE_BASE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_64
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_64
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_64
|
|
#define GET_PDATA_ENTRY bfd_get_32
|
|
|
|
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_peAArch64_bfd_copy_private_bfd_data_common
|
|
#define _bfd_XX_bfd_copy_private_section_data _bfd_peAArch64_bfd_copy_private_section_data
|
|
#define _bfd_XX_get_symbol_info _bfd_peAArch64_get_symbol_info
|
|
#define _bfd_XX_only_swap_filehdr_out _bfd_peAArch64_only_swap_filehdr_out
|
|
#define _bfd_XX_print_private_bfd_data_common _bfd_peAArch64_print_private_bfd_data_common
|
|
#define _bfd_XXi_final_link_postscript _bfd_peAArch64i_final_link_postscript
|
|
#define _bfd_XXi_only_swap_filehdr_out _bfd_peAArch64i_only_swap_filehdr_out
|
|
#define _bfd_XXi_swap_aouthdr_in _bfd_peAArch64i_swap_aouthdr_in
|
|
#define _bfd_XXi_swap_aouthdr_out _bfd_peAArch64i_swap_aouthdr_out
|
|
#define _bfd_XXi_swap_aux_in _bfd_peAArch64i_swap_aux_in
|
|
#define _bfd_XXi_swap_aux_out _bfd_peAArch64i_swap_aux_out
|
|
#define _bfd_XXi_swap_lineno_in _bfd_peAArch64i_swap_lineno_in
|
|
#define _bfd_XXi_swap_lineno_out _bfd_peAArch64i_swap_lineno_out
|
|
#define _bfd_XXi_swap_scnhdr_out _bfd_peAArch64i_swap_scnhdr_out
|
|
#define _bfd_XXi_swap_sym_in _bfd_peAArch64i_swap_sym_in
|
|
#define _bfd_XXi_swap_sym_out _bfd_peAArch64i_swap_sym_out
|
|
#define _bfd_XXi_swap_debugdir_in _bfd_peAArch64i_swap_debugdir_in
|
|
#define _bfd_XXi_swap_debugdir_out _bfd_peAArch64i_swap_debugdir_out
|
|
#define _bfd_XXi_write_codeview_record _bfd_peAArch64i_write_codeview_record
|
|
#define _bfd_XXi_slurp_codeview_record _bfd_peAArch64i_slurp_codeview_record
|
|
|
|
#else /* !COFF_WITH_pep */
|
|
|
|
#define GET_OPTHDR_IMAGE_BASE H_GET_32
|
|
#define PUT_OPTHDR_IMAGE_BASE H_PUT_32
|
|
#define GET_OPTHDR_SIZE_OF_STACK_RESERVE H_GET_32
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE H_PUT_32
|
|
#define GET_OPTHDR_SIZE_OF_STACK_COMMIT H_GET_32
|
|
#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT H_PUT_32
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE H_GET_32
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE H_PUT_32
|
|
#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT H_GET_32
|
|
#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT H_PUT_32
|
|
#define GET_PDATA_ENTRY bfd_get_32
|
|
|
|
#define _bfd_XX_bfd_copy_private_bfd_data_common _bfd_pe_bfd_copy_private_bfd_data_common
|
|
#define _bfd_XX_bfd_copy_private_section_data _bfd_pe_bfd_copy_private_section_data
|
|
#define _bfd_XX_get_symbol_info _bfd_pe_get_symbol_info
|
|
#define _bfd_XX_only_swap_filehdr_out _bfd_pe_only_swap_filehdr_out
|
|
#define _bfd_XX_print_private_bfd_data_common _bfd_pe_print_private_bfd_data_common
|
|
#define _bfd_XXi_final_link_postscript _bfd_pei_final_link_postscript
|
|
#define _bfd_XXi_only_swap_filehdr_out _bfd_pei_only_swap_filehdr_out
|
|
#define _bfd_XXi_swap_aouthdr_in _bfd_pei_swap_aouthdr_in
|
|
#define _bfd_XXi_swap_aouthdr_out _bfd_pei_swap_aouthdr_out
|
|
#define _bfd_XXi_swap_aux_in _bfd_pei_swap_aux_in
|
|
#define _bfd_XXi_swap_aux_out _bfd_pei_swap_aux_out
|
|
#define _bfd_XXi_swap_lineno_in _bfd_pei_swap_lineno_in
|
|
#define _bfd_XXi_swap_lineno_out _bfd_pei_swap_lineno_out
|
|
#define _bfd_XXi_swap_scnhdr_out _bfd_pei_swap_scnhdr_out
|
|
#define _bfd_XXi_swap_sym_in _bfd_pei_swap_sym_in
|
|
#define _bfd_XXi_swap_sym_out _bfd_pei_swap_sym_out
|
|
#define _bfd_XXi_swap_debugdir_in _bfd_pei_swap_debugdir_in
|
|
#define _bfd_XXi_swap_debugdir_out _bfd_pei_swap_debugdir_out
|
|
#define _bfd_XXi_write_codeview_record _bfd_pei_write_codeview_record
|
|
#define _bfd_XXi_slurp_codeview_record _bfd_pei_slurp_codeview_record
|
|
|
|
#endif /* !COFF_WITH_pep */
|
|
|
|
/* These functions are architecture dependent, and are in peicode.h:
|
|
coff_swap_reloc_in
|
|
int coff_swap_reloc_out
|
|
coff_swap_filehdr_in
|
|
coff_swap_scnhdr_in
|
|
pe_mkobject
|
|
pe_mkobject_hook */
|
|
|
|
/* The functions described below are common across all PE/PEI
|
|
implementations architecture types, and actually appear in
|
|
peigen.c. */
|
|
|
|
#define coff_swap_sym_in _bfd_XXi_swap_sym_in
|
|
#define coff_swap_sym_out _bfd_XXi_swap_sym_out
|
|
#define coff_swap_aux_in _bfd_XXi_swap_aux_in
|
|
#define coff_swap_aux_out _bfd_XXi_swap_aux_out
|
|
#define coff_swap_lineno_in _bfd_XXi_swap_lineno_in
|
|
#define coff_swap_lineno_out _bfd_XXi_swap_lineno_out
|
|
#define coff_swap_aouthdr_in _bfd_XXi_swap_aouthdr_in
|
|
#define coff_swap_aouthdr_out _bfd_XXi_swap_aouthdr_out
|
|
#define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out
|
|
|
|
#ifndef coff_final_link_postscript
|
|
#define coff_final_link_postscript _bfd_XXi_final_link_postscript
|
|
#endif
|
|
|
|
void _bfd_XXi_swap_sym_in (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_swap_sym_out (bfd *, void *, void *);
|
|
void _bfd_XXi_swap_aux_in (bfd *, void *, int, int, int, int, void *);
|
|
unsigned _bfd_XXi_swap_aux_out (bfd *, void *, int, int, int, int, void *);
|
|
void _bfd_XXi_swap_lineno_in (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_swap_lineno_out (bfd *, void *, void *);
|
|
void _bfd_XXi_swap_aouthdr_in (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_swap_aouthdr_out (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_swap_scnhdr_out (bfd *, void *, void *);
|
|
bool _bfd_XX_print_private_bfd_data_common (bfd *, void *);
|
|
bool _bfd_XX_bfd_copy_private_bfd_data_common (bfd *, bfd *);
|
|
void _bfd_XX_get_symbol_info (bfd *, asymbol *, symbol_info *);
|
|
bool _bfd_XXi_final_link_postscript (bfd *, struct coff_final_link_info *);
|
|
void _bfd_XXi_swap_debugdir_in (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_swap_debugdir_out (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_write_codeview_record (bfd *, file_ptr, CODEVIEW_INFO *);
|
|
CODEVIEW_INFO *_bfd_XXi_slurp_codeview_record
|
|
(bfd * abfd, file_ptr where, unsigned long length, CODEVIEW_INFO *cvinfo);
|
|
|
|
/* The following are needed only for ONE of pe or pei, but don't
|
|
otherwise vary; peicode.h fixes up ifdefs but we provide the
|
|
prototype. */
|
|
|
|
unsigned _bfd_XX_only_swap_filehdr_out (bfd *, void *, void *);
|
|
unsigned _bfd_XXi_only_swap_filehdr_out (bfd *, void *, void *);
|
|
bool _bfd_XX_bfd_copy_private_section_data
|
|
(bfd *, asection *, bfd *, asection *);
|
|
|
|
bool _bfd_pe_print_ce_compressed_pdata (bfd *, void *);
|
|
bool _bfd_pe64_print_ce_compressed_pdata (bfd *, void *);
|
|
bool _bfd_pex64_print_ce_compressed_pdata (bfd *, void *);
|
|
bool _bfd_peAArch64_print_ce_compressed_pdata (bfd *, void *);
|
|
bool _bfd_pep_print_ce_compressed_pdata (bfd *, void *);
|
|
|