summaryrefslogtreecommitdiffstats
path: root/contrib/binutils/gas/config/tc-ppc.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/binutils/gas/config/tc-ppc.h')
-rw-r--r--contrib/binutils/gas/config/tc-ppc.h71
1 files changed, 48 insertions, 23 deletions
diff --git a/contrib/binutils/gas/config/tc-ppc.h b/contrib/binutils/gas/config/tc-ppc.h
index c2876bf..f4d2f86 100644
--- a/contrib/binutils/gas/config/tc-ppc.h
+++ b/contrib/binutils/gas/config/tc-ppc.h
@@ -1,5 +1,5 @@
/* tc-ppc.h -- Header file for tc-ppc.c.
- Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Support.
@@ -56,7 +56,7 @@ extern int target_big_endian;
/* The target BFD format. */
#define TARGET_FORMAT (ppc_target_format ())
-extern char* ppc_target_format ();
+extern char *ppc_target_format PARAMS ((void));
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
@@ -82,8 +82,34 @@ extern char* ppc_target_format ();
/* We don't need to handle .word strangely. */
#define WORKING_DOT_WORD
-/* We set the fx_done field appropriately in md_apply_fix. */
-#define TC_HANDLES_FX_DONE
+#define MAX_MEM_FOR_RS_ALIGN_CODE 4
+#define HANDLE_ALIGN(FRAGP) \
+ if ((FRAGP)->fr_type == rs_align_code) \
+ { \
+ valueT count = ((FRAGP)->fr_next->fr_address \
+ - ((FRAGP)->fr_address + (FRAGP)->fr_fix)); \
+ if (count != 0 && (count & 3) == 0) \
+ { \
+ unsigned char *dest = (FRAGP)->fr_literal + (FRAGP)->fr_fix; \
+ \
+ (FRAGP)->fr_var = 4; \
+ if (target_big_endian) \
+ { \
+ *dest++ = 0x60; \
+ *dest++ = 0; \
+ *dest++ = 0; \
+ *dest++ = 0; \
+ } \
+ else \
+ { \
+ *dest++ = 0; \
+ *dest++ = 0; \
+ *dest++ = 0; \
+ *dest++ = 0x60; \
+ } \
+ } \
+ }
+
#ifdef TE_PE
@@ -197,6 +223,8 @@ do { \
|| (FIXP)->fx_r_type == BFD_RELOC_PPC_B16_BRNTAKEN \
|| (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRTAKEN \
|| (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRNTAKEN \
+ || (BFD_DEFAULT_TARGET_SIZE == 64 \
+ && (FIXP)->fx_r_type == BFD_RELOC_PPC64_TOC) \
|| (FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \
|| (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
@@ -216,6 +244,12 @@ extern int ppc_section_flags PARAMS ((int, int, int));
#define md_elf_section_word(STR, LEN) ppc_section_word (STR, LEN)
#define md_elf_section_flags(FLAGS, ATTR, TYPE) ppc_section_flags (FLAGS, ATTR, TYPE)
+#if BFD_DEFAULT_TARGET_SIZE == 64
+/* Extra sections for 64-bit ELF PPC. */
+#define ELF_TC_SPECIAL_SECTIONS \
+ { ".toc", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, \
+ { ".tocbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE},
+#else
/* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a
normal section, and not a bss section so that the linker doesn't crater
when trying to make more than 2 sections. */
@@ -227,26 +261,14 @@ extern int ppc_section_flags PARAMS ((int, int, int));
{ ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \
{ ".PPC.EMB.sdata0", SHT_PROGBITS, SHF_ALLOC }, \
{ ".PPC.EMB.sbss0", SHT_PROGBITS, SHF_ALLOC },
+#endif
#define tc_comment_chars ppc_comment_chars
extern const char *ppc_comment_chars;
/* Keep relocations relative to the GOT, or non-PC relative. */
-#define tc_fix_adjustable(FIX) \
- ((FIX)->fx_r_type != BFD_RELOC_16_GOTOFF \
- && (FIX)->fx_r_type != BFD_RELOC_LO16_GOTOFF \
- && (FIX)->fx_r_type != BFD_RELOC_HI16_GOTOFF \
- && (FIX)->fx_r_type != BFD_RELOC_HI16_S_GOTOFF \
- && (FIX)->fx_r_type != BFD_RELOC_GPREL16 \
- && (FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \
- && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY \
- && ! S_IS_EXTERNAL ((FIX)->fx_addsy) \
- && ! S_IS_WEAK ((FIX)->fx_addsy) \
- && ((FIX)->fx_pcrel \
- || ((FIX)->fx_subsy != NULL \
- && (S_GET_SEGMENT ((FIX)->fx_subsy) \
- == S_GET_SEGMENT ((FIX)->fx_addsy))) \
- || S_IS_LOCAL ((FIX)->fx_addsy)))
+#define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp)
+extern int ppc_fix_adjustable PARAMS ((struct fix *));
/* We must never ever try to resolve references to externally visible
symbols in the assembler, because the .o file might go into a shared
@@ -258,17 +280,20 @@ extern const char *ppc_comment_chars;
&& S_IS_DEFINED ((FIX)->fx_addsy) \
&& ! S_IS_COMMON ((FIX)->fx_addsy)))
+#if BFD_DEFAULT_TARGET_SIZE == 64
+/* Finish up the symbol. */
+#define tc_frob_symbol(sym, punt) punt = ppc_elf_frob_symbol (sym)
+extern int ppc_elf_frob_symbol PARAMS ((symbolS *));
+#endif
+
#define DWARF2_LINE_MIN_INSN_LENGTH 4
#endif /* OBJ_ELF */
-/* call md_apply_fix3 with segment instead of md_apply_fix */
-#define MD_APPLY_FIX3
-
/* call md_pcrel_from_section, not md_pcrel_from */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC)
extern long md_pcrel_from_section PARAMS ((struct fix *, segT));
-#define md_parse_name(name, exp) ppc_parse_name (name, exp)
+#define md_parse_name(name, exp, c) ppc_parse_name (name, exp)
extern int ppc_parse_name PARAMS ((const char *, struct expressionS *));
#define md_operand(x)
OpenPOWER on IntegriCloud