binutils-gdb/binutils/testsuite/binutils-all
Tamar Christina b69c9d41e8 AArch64: Add support for AArch64 EFI (efi-*-aarch64).
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.
2021-11-23 09:36:39 +00:00
..
aarch64 AArch64: Add support for AArch64 EFI (efi-*-aarch64). 2021-11-23 09:36:39 +00:00
arc
arm
bfin
hppa
i386
m68k
mips MIPS/opcodes: Do not use CP0 register names for control registers 2021-05-29 03:26:32 +02:00
nfp
riscv riscv: print .2byte or .4byte before an unknown instruction encoding 2021-09-20 09:45:34 +01:00
vax
wasm32
windres
x86-64 readelf: report DF_1_PIE as "Position-Independent Executable" 2021-06-15 13:24:57 +09:30
add-empty-section.d
add-section.d
add-symbol.d
alias-2.def
alias.def
ar.exp
bintest.s
common-1.s
common-1a.d
common-1b.d
common-1c.d
common-1d.d
common-1e.d
common-1f.d
common-2.s
common-2a.d
common-2b.d
common-2c.d
common-2d.d
common-2e.d
common-2f.d
compress.exp
copy-1.d
copy-1.s
copy-2.d
copy-3.d
copy-4.d
copy-5.d
copy-6.d
copytest.s
cxxfilt.exp
data-sections.s
debug_str.d
debug_str.s
debuginfod.exp binutils debuginfod test 2021-11-23 15:39:26 +10:30
debuglink.s
disasm.s
dlltool.exp
dumptest.s
dw2-1.S
dw2-1.W
dw2-2.S
dw2-3.rS
dw2-3.rt
dw2-3.S
dw2-3.W
dw2-3gabi.W
dw2-compressed.S
dw2-decodedline-1.S
dw2-decodedline.S
dw2-empty.S
dw2-ranges.S
dw2-ranges.W
dw4.s
dw5.S
dw5.W
dwarf-attributes.S
dwarf-attributes.W
dwo.s
elfedit-1.d
elfedit-2.d
elfedit-3.d
elfedit-4.d
elfedit-5.d
elfedit-6.d elfedit: Add --output-abiversion option to update ABIVERSION 2021-11-17 05:15:48 -08:00
elfedit.exp elfedit: Add --output-abiversion option to update ABIVERSION 2021-11-17 05:15:48 -08:00
empty
empty-file
empty.s
exclude-1.s
exclude-1a.d
exclude-1b.d
fastcall.def
group-2.s
group-3.s
group-4.s
group-5.d
group-5.s
group-6.d
group-6.s
group-7.s
group-7a.d
group-7b.d
group-7c.d
group.s
ifunc.s
keep-section-1.d
keep-section-2.d
libdw2-compressed.out
libdw2-compressedgabi.out
libdw2.out
link-order.s
linkdebug.s
localize-hidden-1.d
localize-hidden-1.s
localize-hidden-2.d
localize-hidden-2.s
locview-1.s
locview-2.s
mangled.s
mbind1.s
needed-by-reloc.s
nm-1.s
nm-elf-1.s
nm-ver.s
nm.exp Deprecate a.out support for NetBSD targets. 2021-08-11 13:17:54 +01:00
note-1.d
note-2-32.d
note-2-32.s
note-2-64.d
note-2-64.s
note-3-32.d
note-3-32.s
note-3-64.d
note-3-64.s
note-3.32.s
note-4-32.d
note-4-32.s
note-4-64.d
note-4-64.s
note-5.d
note-5.s
note-6-32.d
note-6-32.s
note-6-64.d
note-6-64.s
objcopy.exp objdump -S test fail on mingw 2021-08-24 20:39:29 +09:30
objdump.exp LoongArch binutils support 2021-10-24 21:36:31 +10:30
objdump.s
objdump.W
objdump.Wk
objdump.WK2
objdump.WK3
objdump.WL
only-section-01.d
pr18374.s
pr19020.in
pr19020a.d
pr19020b.d
pr19547.c
pr23633.d
pr23633.list
pr23633.s
pr25543.d
pr25543.s
pr25662-pdp11.s
pr25662.ld
pr25662.s
pr26112.o.bz2
pr26112.r
pr26160.dwp.bz2
pr26160.r
pr26548.d
pr26548.s
pr26548e.d
readelf-maskos-1a.d
readelf-maskos-1b.d
readelf-maskos-unknown.s
readelf-maskos.s
readelf.demangled
readelf.exp readelf: Reset file position to beginning for thin archive members 2021-07-01 12:01:55 +01:00
readelf.h
readelf.h.thin readelf: Reset file position to beginning for thin archive members 2021-07-01 12:01:55 +01:00
readelf.k
readelf.k2
readelf.locview-1
readelf.locview-2
readelf.n
readelf.pr18374
readelf.r
readelf.r-64
readelf.s RISC-V: Enable elf attributes when default configure option isn't set. 2021-07-13 14:07:57 +08:00
readelf.s-64 RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.s-64-unused RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.ss RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.ss-64 RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.ss-64-unused RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.ss-mips
readelf.ss-tmips
readelf.ss-unused RISC-V: PR27916, Support mapping symbols. 2021-08-30 17:36:11 +08:00
readelf.wa
readelf.wKis
readelf.z
remove-relocs-01.d
remove-relocs-01.s
remove-relocs-02.d
remove-relocs-03.d
remove-relocs-04.d
remove-relocs-05.d
remove-relocs-06.d
remove-relocs-07.d
remove-relocs-07.s
remove-relocs-08.d
remove-section-01.d
retain1.s
retain1a.d
retain1b.d
set-section-alignment.d
size.exp
strings-1.bin
strings.exp
strip-1.d
strip-2.d
strip-3.d
strip-4.d
strip-5.d
strip-6.d
strip-7.d
strip-8.d
strip-9.d
strip-10.d
strip-11.d
strip-12.d
strip-12.s
strip-13.d
strip-13mips64.s
strip-13rel.s
strip-13rela.s
strip-14.d
strip-14mips64.s
strip-14rel.s
strip-14rela.s
strip-15.d
strip-15mips64.s
strip-15rel.s
strip-15rela.s
symbols-1.d
symbols-2.d
symbols-3.d
symbols-4.d
symbols.s
testprog.c
testranges-ia64.d
testranges-ia64.s
testranges.d
testranges.s
unique.s
unknown.s
update-1.s
update-2.s
update-3.s
update-4.s
update-section.exp
verilog-1.hex
verilog-2.hex
verilog-4.hex
verilog-8.hex
verilogtest.s
version.def
version.s
z.s
zero-sec.r
zero-sec.s