This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_25-branch] PowerPC register numbers in DWARF
- From: Alan Modra <amodra at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 11 Feb 2015 12:49:18 -0000
- Subject: [binutils-gdb/binutils-2_25-branch] PowerPC register numbers in DWARF
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ca78c40e846a5be76c76482569ebf09459faafe1
commit ca78c40e846a5be76c76482569ebf09459faafe1
Author: Alan Modra <amodra@gmail.com>
Date: Fri Dec 12 16:02:34 2014 +1030
PowerPC register numbers in DWARF
This makes gas .cfi output to .debug_frame match register numbering
emitted by gcc. md_reg_eh_frame_to_debug_frame follows the ABI,
targets not using it, notably Linux, don't.
* config/tc-ppc.h (md_reg_eh_frame_to_debug_frame): Match current
gcc behaviour.
* config/te-aix.h: New file.
* configure.tgt: Use em=aix for powerpc-aix.
Diff:
---
gas/ChangeLog | 9 +++++++++
gas/config/tc-ppc.h | 17 +++++++++++++++--
gas/config/te-aix.h | 22 ++++++++++++++++++++++
gas/configure.tgt | 2 +-
4 files changed, 47 insertions(+), 3 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b4f0eea..f7945e6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2015-02-11 Alan Modra <amodra@gmail.com>
+
+ Apply from master.
+ 2014-12-12 Alan Modra <amodra@gmail.com>
+ * config/tc-ppc.h (md_reg_eh_frame_to_debug_frame): Match current
+ gcc behaviour.
+ * config/te-aix.h: New file.
+ * configure.tgt: Use em=aix for powerpc-aix.
+
2015-01-28 Matthew Wahab <matthew.wahab@arm.com>
* config/tc-arm.c (parse_ifimm_zero): Accept #0x0 as a synonym for #0,
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index 3cd9bf1..d9551c1 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -267,11 +267,24 @@ extern int ppc_parse_name (const char *, struct expressionS *);
#define md_cleanup() ppc_cleanup ()
extern void ppc_cleanup (void);
+#if (defined TE_AIX5 || defined TE_AIX \
+ || defined TE_FreeBSD || defined TE_NetBSD || defined TE_LYNX)
/* ppc uses different register numbers between .eh_frame and .debug_frame.
This macro translates the .eh_frame register numbers to .debug_frame
register numbers. */
-#define md_reg_eh_frame_to_debug_frame(regno) \
- ((regno) == 70 ? 64 /* cr2 */ : (regno))
+#define md_reg_eh_frame_to_debug_frame(regno) \
+ ((regno) == 70 ? 64 /* cr2 */ \
+ : (regno) == 65 ? 108 /* lr */ \
+ : (regno) == 66 ? 109 /* ctr */ \
+ : (regno) >= 68 && (regno) <= 75 ? (regno) + 86 - 68 /* crN */ \
+ : (regno) == 76 ? 101 /* xer */ \
+ : (regno) >= 77 && (regno) <= 108 ? (regno) + 1124 - 77 /* vrN */ \
+ : (regno) == 109 ? 356 /* vrsave */ \
+ : (regno) == 110 ? 67 /* vscr */ \
+ : (regno) == 111 ? 99 /* spe_acc */ \
+ : (regno) == 112 ? 612 /* spefscr */ \
+ : (regno))
+#endif
#define TARGET_USE_CFIPOP 1
diff --git a/gas/config/te-aix.h b/gas/config/te-aix.h
new file mode 100644
index 0000000..b0da4fb
--- /dev/null
+++ b/gas/config/te-aix.h
@@ -0,0 +1,22 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+
+ This file is part of GAS, the GNU Assembler.
+
+ GAS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3,
+ or (at your option) any later version.
+
+ GAS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
+ the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GAS; see the file COPYING. If not, write to the Free
+ Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#define TE_AIX
+
+#include "obj-format.h"
diff --git a/gas/configure.tgt b/gas/configure.tgt
index d07d445..9abc768 100644
--- a/gas/configure.tgt
+++ b/gas/configure.tgt
@@ -372,7 +372,7 @@ case ${generic_target} in
ppc-*-winnt*) fmt=coff em=pe ;;
ppc-*-aix5.[01]) fmt=coff em=aix5 ;;
ppc-*-aix[5-9].*) fmt=coff em=aix5 ;;
- ppc-*-aix*) fmt=coff ;;
+ ppc-*-aix*) fmt=coff em=aix ;;
ppc-*-beos*) fmt=coff ;;
ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;