aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-aarch64.c
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@cavium.com>2015-09-07 17:06:18 +0800
committerAndrew Pinski <apinski@cavium.com>2016-08-31 13:06:39 -0700
commitd6920a97310001d6cae414b91d4b40829b1600fa (patch)
treeb137971c40f7fb47c04e957bc6d7592701eaaffb /bfd/elfnn-aarch64.c
parent3aa5cfa0d1cdbbd839884302535da28ca8c8b00d (diff)
downloadgdb-d6920a97310001d6cae414b91d4b40829b1600fa.zip
gdb-d6920a97310001d6cae414b91d4b40829b1600fa.tar.gz
gdb-d6920a97310001d6cae414b91d4b40829b1600fa.tar.bz2
Move AARCH64 ILP32 rejection handling
For AARCH64 ILP32, we reject compatibility too early on to support gdb ILP32. This patch moves ILP32 rejection from compatible to elfNN_aarch64_merge_private_bfd_data which allows aarch64 and aarch64:ilp32 to be handled correctly with gdb. An added bonus is that we can have an error message on why two object files are rejected. OK? Tested both binutils and gdb. Thanks, Andrew Pinski 2016-08-31 Andrew Pinski <apinski@cavium.com> * cpu-aarch64.c (compatible): Don't reject different mach or ILP32 here. * elfnn-aarch64.c (elfNN_aarch64_merge_private_bfd_data): Add an error message on why endianess is rejected. Reject different ILP32/LP64 settings. Signed-off-by: Andrew Pinski <apinski@cavium.com>
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 3435a3d..1e27501 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -6530,11 +6530,26 @@ elfNN_aarch64_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
/* Check if we have the same endianess. */
if (!_bfd_generic_verify_endian_match (ibfd, obfd))
- 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