2010-03-15 Thomas Schwinge <thomas@codesourcery.com>
[binutils-gdb.git] / gas / config / tc-ppc.h
index 5f6f7f23d4373c910330ebed077ed66c363534d0..be474bde59f5ffb406b82b46e130a0c277850b6b 100644 (file)
@@ -1,6 +1,6 @@
 /* tc-ppc.h -- Header file for tc-ppc.c.
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of GAS, the GNU Assembler.
@@ -22,6 +22,8 @@
 
 #define TC_PPC
 
+#include "opcode/ppc.h"
+
 struct fix;
 
 /* Set the endianness we are using.  Default to big endian.  */
@@ -95,10 +97,10 @@ extern void ppc_handle_align (struct frag *);
    for later use in md_apply_fix.  */
 struct _ppc_fix_extra
 {
-  unsigned long ppc_cpu;
+  ppc_cpu_t ppc_cpu;
 };
 
-extern unsigned long ppc_cpu;
+extern ppc_cpu_t ppc_cpu;
 
 #define TC_FIX_TYPE struct _ppc_fix_extra
 #define TC_INIT_FIX_DATA(FIXP) \
@@ -132,7 +134,7 @@ struct ppc_tc_sy
      .globl or .lglobl statement.  */
   int output;
   /* The symbol class.  */
-  int class;
+  int symbol_class;
   /* The real name, if the symbol was renamed.  */
   char *real_name;
   /* For a csect symbol, the subsegment we are using.  This is zero
@@ -193,7 +195,7 @@ do {                                                                \
     S_SET_SEGMENT (dest, S_GET_SEGMENT (src));                 \
   symbol_get_tc (dest)->size = symbol_get_tc (src)->size;      \
   symbol_get_tc (dest)->align = symbol_get_tc (src)->align;    \
-  symbol_get_tc (dest)->class = symbol_get_tc (src)->class;    \
+  symbol_get_tc (dest)->symbol_class = symbol_get_tc (src)->symbol_class;      \
   symbol_get_tc (dest)->within = symbol_get_tc (src)->within;  \
 } while (0)
 
@@ -205,10 +207,10 @@ extern const char       ppc_symbol_chars[];
 #ifdef OBJ_ELF
 
 /* Support for SHF_EXCLUDE and SHT_ORDERED */
-extern int ppc_section_letter (int, char **);
+extern bfd_vma ppc_section_letter (int, char **);
 extern int ppc_section_type (char *, size_t);
-extern int ppc_section_word (char *, size_t);
-extern int ppc_section_flags (int, int, int);
+extern bfd_vma ppc_section_word (char *, size_t);
+extern int ppc_section_flags (flagword, bfd_vma, int);
 
 #define md_elf_section_letter(LETTER, PTR_MSG) ppc_section_letter (LETTER, PTR_MSG)
 #define md_elf_section_type(STR, LEN)          ppc_section_type (STR, LEN)
@@ -247,6 +249,12 @@ extern int ppc_parse_name (const char *, struct expressionS *);
 #define md_cleanup() ppc_cleanup ()
 extern void ppc_cleanup (void);
 
+/* 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 TARGET_USE_CFIPOP 1
 
 #define tc_cfi_frame_initial_instructions ppc_cfi_frame_initial_instructions