This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Patch 1 of 2 for aarch64 ILP32 support in gdb


On 17-01-24 16:18:49, Steve Ellcey wrote:
> --- a/bfd/cpu-aarch64.c
> +++ b/bfd/cpu-aarch64.c
> @@ -25,7 +25,8 @@
>  
>  /* This routine is provided two arch_infos and works out which Aarch64
>     machine which would be compatible with both and returns a pointer
> -   to its info structure.  */
> +   to its info structure.  ABI (ilp32 vs. lp64) and endianness compatibility
> +   are checked in elfNN_aarch64_merge_private_bfd_data.  */
>  
>  static const bfd_arch_info_type *
>  compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
> @@ -38,10 +39,6 @@ compatible (const bfd_arch_info_type * a, const bfd_arch_info_type * b)
>    if (a->mach == b->mach)
>      return a;
>  
> -  /* Don't allow mixing ilp32 with lp64.  */
> -  if ((a->mach & bfd_mach_aarch64_ilp32) != (b->mach & bfd_mach_aarch64_ilp32))
> -    return NULL;
> -

Hi Steve,
GDB uses this function to check if selected arch is compatible with
the target arch.  If I load an ilp32 binary in aarch64 gdb, and connect
to gdbserver, I'll get a warning as below,

Reading symbols from ../1.o...(no debugging symbols found)...done.
(gdb) target remote linaro-junor1-1:1234
Remote debugging using linaro-junor1-1:1234
warning: Selected architecture aarch64:ilp32 is not compatible with reported target architecture aarch64

with your patch applied, the warning goes way.

(gdb) target remote linaro-junor1-1:1234
Remote debugging using linaro-junor1-1:1234
Reading /scratch/yao/toolchain/gcc-7/aarch64-linux-gnu/sysroot/lib/ld-linux-aarch64.so.1 from remote target...
Reading /scratch/yao/toolchain/gcc-7/aarch64-linux-gnu/sysroot/lib/ld-linux-aarch64.so.1 from remote target...
Reading symbols from target:/scratch/yao/toolchain/gcc-7/aarch64-linux-gnu/sysroot/lib/ld-linux-aarch64.so.1...done.
Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing: 
0x0000ffffb7fd2d00 in _start () from target:/scratch/yao/toolchain/gcc-7/aarch64-linux-gnu/sysroot/lib/ld-linux-aarch64.so.1

IMO, the warning above is useful, since aarch64:ilp32 is not supported
in gdb, can we commit this patch after ilp32 is supported in GDB (if
this patch only affects GDB).

-- 
Yao (齐尧)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]