On Thu, 2017-01-26 at 14:14 +0000, Yao Qi wrote: >  > Could you remove these ilp32 xml files, use the existing aarch64 target > description, and try the patch below? Yao, I removed the ilp32 xml files and applied the patch you included and made the other changes.  gdb seems to be working as well as it did with the original patch but I ran into a problem that I missed before. If I apply the gdb/gdbserver patch attached to this email and the earlier bfd patch: https://sourceware.org/ml/gdb-patches/2017-01/msg00508.html and I try to run gdb on an ILP32 program I get: (gdb) r Starting program: /home/ubuntu/sellcey/gdb-ilp32/x32  PC register is not available I didn't see this before because I didn't have this bfd patch: https://sourceware.org/ml/binutils/2016-12/msg00167.html That patch seems reasonable and it fixed some test failures I had in the glibc testsuite but it is breaking gdb.  If I undo this patch by making this change to bfd/cpu-aarch64.c:  static const bfd_arch_info_type bfd_aarch64_arch_ilp32 = -  N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 32, FALSE, NULL); +  N (bfd_mach_aarch64_ilp32, "aarch64:ilp32", 64, FALSE, NULL); Then gdb starts working again and I can debug 32 bit programs. I am not sure how this change to the ILP32 aarch64 bfd description is affecting gdb and why this change would break things.  Do you know why this change messes up gdb? Steve Ellcey sellcey@cavium.com 2017-01-27  Andrew Pinski       Steve Ellcey       Yao Qi   * aarch64-linux-tdep.c (aarch64_linux_init_abi): Set link map offsets to 32 or 64 bits. * aarch64-tdep.c (aarch64_ilp32_register_type): New function. (aarch64_gdbarch_init): Setup ILP32 support. Make sure the gdbarches have compatible ilp32 flags. Set long and ptr sizes correctly for ilp32. * aarch64-tdep.h (gdbarch_tdep) : New field. 2017-01-27  Andrew Pinski       Steve Ellcey   * linux-aarch64-low.c (aarch64_linux_read_description): Use machine instead of is_elf64 to determine architecture.  Give an error when using 32 bit gdbserver on 64 bit program.