summaryrefslogtreecommitdiff
path: root/bfd/elfnn-aarch64.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-10-23 14:50:18 +0100
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-04-27 14:38:50 +0200
commit4e556d512fa9014a7c68d33310171f18301236e4 (patch)
tree255e6c27a9fda8812d68890f1d5d8dfe6212ad3e /bfd/elfnn-aarch64.c
parentb755db3c98137baaff8a154d936d326d9a9c72a7 (diff)
ILP32: BFD
Rebased 2c5e2ba3ced851a18c488c630abd00ca99523bbd from linaro's gdb-aarch64-ilp32 branch on GDB 8.1-release. bfd: 2017-03-06 Andrew Pinski <apinski@cavium.com> Steve Ellcey <sellcey@cavium.com> * cpu-aarch64.c (compatible): Don't reject different ILP32/LP64 ABI's here. * elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data): Add an error message on why endianess is rejected. Reject different ILP32/LP64 ABI settings. * elfxx-aarch64.c (_bfd_aarch64_elf_grok_prstatus): Handle size and offset of ILP32 executables. (_bfd_aarch64_elf_grok_psinfo): Ditto.
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r--bfd/elfnn-aarch64.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index d5711e0eb1..82fc002429 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -6591,11 +6591,26 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
/* Check if we have the same endianess. */
if (!_bfd_generic_verify_endian_match (ibfd, info))
- return FALSE;
+ {
+ (*_bfd_error_handler)
+ (_("%B: endianness incompatible with that of the selected emulation"),
+ ibfd);
+ return FALSE;
+ }
if (!is_aarch64_elf (ibfd) || !is_aarch64_elf (obfd))
return TRUE;
+ /* Don't allow mixing ilp32 with lp64. */
+ if ((bfd_get_arch_info (ibfd)->mach & bfd_mach_aarch64_ilp32)
+ != (bfd_get_arch_info (obfd)->mach & bfd_mach_aarch64_ilp32))
+ {
+ (*_bfd_error_handler)
+ (_("%B: ABI is incompatible with that of the selected emulation: \"%s\" != \"%s\""),
+ ibfd, bfd_get_target (ibfd), bfd_get_target (obfd));
+ return FALSE;
+ }
+
/* The input BFD must have had its flags initialised. */
/* The following seems bogus to me -- The flags are initialized in
the assembler but I don't think an elf_flags_init field is