~ubuntu-support-team/binutils/+git/binutils-gdb:users/ARM/efi-aarch64-support-binutils

Last commit made on 2021-10-21
Get this branch:
git clone -b users/ARM/efi-aarch64-support-binutils https://git.launchpad.net/~ubuntu-support-team/binutils/+git/binutils-gdb

Branch merges

Branch information

Name:
users/ARM/efi-aarch64-support-binutils
Repository:
lp:~ubuntu-support-team/binutils/+git/binutils-gdb

Recent commits

981118a... by Tamar Christina <email address hidden>

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 tagret 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.

As such it's not valid for use with gas but only with objcopy.

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 <email address hidden>

 PR binutils/26218
 * .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 <email address hidden>

 PR binutils/26218
 * 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 <email address hidden>

 PR binutils/26218
 * coff/aarch64.h: New file.
 * coff/pe.h (IMAGE_FILE_MACHINE_ARM64): New.

e68b7db... by Tom Tromey <email address hidden>

Fix no-Python build

A build without Python will currently fail, because
selftests::test_python uses gdb_python_initialized, which is only
conditionally defined.

This patch fixes the build by making test_python also be conditionally
defined. I chose this approach because the selftest will fail if
Python is not enabled, so it didn't seem useful to leave it defined.

18287cf... by Nelson Chu <email address hidden>

RISC-V: Update the assembler insn testcase.

Since the 0x57 is preserved for the vadd.vv instruction in the integration
branch, remove it to make sure the testcase can work.

gas/
 * testsuite/gas/riscv/insn.d: Remove 0x57 since it is preserved
 for vadd.vv instruction.
 * testsuite/gas/riscv/insn.s: Likewise.

1684959... by Jan Beulich <email address hidden>

MIPS: don't use get_symbol_name() for section parsing. With s_change_section() later calling obj_elf_section(), it seems better to pre-parse the section name by the same function that will be used there. This way no differences in what is accepted will result.

gas * config/tc-mips.c (s_change_section): Use obj_elf_section_name to
 parse the section name.

5a2947c... by Jan Beulich <email address hidden>

ia64: don't use get_symbol_name() for section parsing. With cross_section() later calling obj_elf_section(), it seems better to pre-parse the section name by the same function that will be used there. This way no differences in what is accepted will result.

gas * config/tc-ia64.c (cross_section): Use obj_elf_section_name to
 parse the section name.

7486cb6... by Tom de Vries <email address hidden>

[gdb/testsuite] Fix gdb.gdb/selftest.exp

With a gdb build with CFLAGS "-O2 -g -flto=auto", I run into:
...
 #7 gdb_main (args=0x7fffffffd220) at src/gdb/main.c:1368^M
 #8 main (argc=<optimized out>, argv=<optimized out>) at src/gdb/gdb.c:32^M
 (gdb) FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
...
which means that this regexp in proc test_with_self fails:
...
  -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
...

The problem is that gdb_main has been inlined into main, and consequently the
backtrace uses:
...
 #x <fn> ...
...
instead of
...
 #x <address> in <fn> ...
...

Fix this by updating the regexp to not require "in" before " main".

Tested on x86_64-linux.

fd52555... by Alan Modra

Re: Deprecate a.out support for NetBSD targets

 * config.bfd: Correct m68-*-*bsd* obsolete target match.

003fa0d... by Tom de Vries <email address hidden>

[gdb/testsuite] Fix test name in gdb.base/batch-exit-status.exp

When running gdb.base/batch-exit-status.exp I noticed that the test name
contains a newline:
...
PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
: No such file or directory\.: [lindex $result 2] == 0
...

The mistake is that I passed an output regexp argument to a parameter
interpreted as testname prefix. Fix this by passing a testname prefix
instead.

Add support for checking output, to be able to handle the output regexp
argument.

Tested on x86_64-linux.

52e5dce... by GDB Administrator <email address hidden>

Automatic date update in version.in

a02a90c... by Tom de Vries <email address hidden>

[gdb/testsuite] Set sysroot earlier in local-board.exp

When running test-case gdb.base/batch-exit-status.exp for native, it passes.
But with target board cc-with-debug-names, we run into (added missing double
quotes for clarity):
...
builtin_spawn $build/gdb/testsuite/../../gdb/gdb -nw -nx \
  -data-directory $build/gdb/testsuite/../data-directory \
  -iex "set height 0" -iex "set width 0" -ex "set sysroot" -batch ""^M
: No such file or directory.^M
PASS: gdb.base/batch-exit-status.exp: \
  : No such file or directory\.: [lindex $result 2] == 0
FAIL: gdb.base/batch-exit-status.exp: \
  : No such file or directory\.: [lindex $result 3] == $expect_status
...

The difference between the passing and failing case is that with native we
have (leaving out set height/width for brevity):
...
$ gdb -batch ""; echo $?
: No such file or directory.
1
...
and with target board cc-with-debug-names:
...
$ gdb -ex "set sysroot" -batch ""; echo $?
: No such file or directory.
0
...

The difference is expected. GDB returns the exit status of the last executed
command. In the former case that's 'file ""', which fails. In the latter case,
that's 'set sysroot', which succeeds.

Fix this by setting sysroot using -iex instead of -ex in local-board.exp, such
that we have the expected:
...
$ gdb -iex "set sysroot" -batch ""; echo $?
: No such file or directory.
1
...

Tested on x86_64-linux.