aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog19
-rw-r--r--gas/as.c3
-rw-r--r--gas/config/obj-coff.c2
-rw-r--r--gas/config/tc-ppc.c68
-rw-r--r--gas/config/tc-ppc.h26
5 files changed, 94 insertions, 24 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a8acd9a..7d6e2b9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,22 @@
+Mon Apr 24 15:21:11 2000 Clinton Popetz <cpopetz@cygnus.com>
+
+ * as.c (parse_args): Allow md_parse_option to override -a listing
+ option.
+ * config/obj-coff.c (add_lineno): Change type of offset parameter
+ from "int" to "bfd_vma."
+ * config/tc-ppc.c (md_pseudo_table): Add "llong" and "machine."
+ (ppc_mach, ppc_subseg_align, ppc_target_format): New.
+ (ppc_change_csect): Align correctly for XCOFF64.
+ (ppc_machine): New function, which discards "ppc_machine" line.
+ (ppc_tc): Cons for 8 when code is 64 bit.
+ (md_apply_fix3): Don't check operand->insert. Handle 64 bit
+ relocations.
+ (md_parse_option): Handle -a64 and -a32.
+ (ppc_xcoff64): New.
+ * config/tc-ppc.h (TARGET_MACH): Define.
+ (TARGET_FORMAT): Move to function.
+ (SUB_SEGMENT_ALIGN): Use ppc_subseg_align.
+
2000-04-26 David O'Brien <obrien@FreeBSD.org>
* doc/as.1: Fix unbalanced brackets.
diff --git a/gas/as.c b/gas/as.c
index 9bac61d..e34807b 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -672,6 +672,9 @@ the GNU General Public License. This program has absolutely no warranty.\n"));
case 'a':
if (optarg)
{
+ if (md_parse_option (optc, optarg) != 0)
+ break;
+
while (*optarg)
{
switch (*optarg)
diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c
index d750868..11648b9 100644
--- a/gas/config/obj-coff.c
+++ b/gas/config/obj-coff.c
@@ -429,7 +429,7 @@ int coff_n_line_nos;
static void
add_lineno (frag, offset, num)
fragS *frag;
- int offset;
+ addressT offset;
int num;
{
struct line_no *new_line =
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 365a535..cac5d6a 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -86,6 +86,7 @@ static void ppc_stabx PARAMS ((int));
static void ppc_rename PARAMS ((int));
static void ppc_toc PARAMS ((int));
static void ppc_xcoff_cons PARAMS ((int));
+static void ppc_machine PARAMS ((int));
static void ppc_vbyte PARAMS ((int));
#endif
@@ -182,9 +183,11 @@ const pseudo_typeS md_pseudo_table[] =
{ "text", ppc_section, 't' },
{ "toc", ppc_toc, 0 },
{ "long", ppc_xcoff_cons, 2 },
+ { "llong", ppc_xcoff_cons, 3 },
{ "word", ppc_xcoff_cons, 1 },
{ "short", ppc_xcoff_cons, 1 },
{ "vbyte", ppc_vbyte, 0 },
+ { "machine", ppc_machine, 0 },
#endif
#ifdef OBJ_ELF
@@ -591,6 +594,9 @@ static int ppc_cpu = 0;
PPC_OPCODE_32 or PPC_OPCODE_64. */
static unsigned long ppc_size = PPC_OPCODE_32;
+/* Whether to target xcoff64 */
+static int ppc_xcoff64 = 0;
+
/* Opcode hash table. */
static struct hash_control *ppc_hash;
@@ -740,6 +746,16 @@ md_parse_option (c, arg)
break;
#endif
+ /* a64 and a32 determine whether to use XCOFF64 or XCOFF32. */
+ case 'a':
+ if (strcmp (arg, "64") == 0)
+ ppc_xcoff64 = 1;
+ else if (strcmp (arg, "32") == 0)
+ ppc_xcoff64 = 0;
+ else
+ return 0;
+ break;
+
case 'm':
/* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2
(RIOS2). */
@@ -948,6 +964,37 @@ ppc_arch ()
return bfd_arch_unknown;
}
+unsigned long
+ppc_mach ()
+{
+ return (ppc_size == PPC_OPCODE_64) ? 620 : 0;
+}
+
+int
+ppc_subseg_align()
+{
+ return (ppc_xcoff64) ? 3 : 2;
+}
+
+extern char*
+ppc_target_format()
+{
+#ifdef OBJ_COFF
+#ifdef TE_PE
+ return (target_big_endian ? "pe-powerpc" : "pe-powerpcle");
+#elif TE_POWERMAC
+#else
+ return (ppc_xcoff64 ? "aixcoff64-rs6000" : "aixcoff-rs6000");
+#endif
+#ifdef TE_POWERMAC
+ return "xcoff-powermac";
+#endif
+#endif
+#ifdef OBJ_ELF
+ return (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle");
+#endif
+}
+
/* This function is called when the assembler starts up. It is called
after the options have been parsed and the output file has been
opened. */
@@ -2478,7 +2525,7 @@ ppc_change_csect (sym)
symbol_set_frag (sym, frag_now);
S_SET_VALUE (sym, (valueT) frag_now_fix ());
- symbol_get_tc (sym)->align = 2;
+ symbol_get_tc (sym)->align = (ppc_xcoff64) ? 3 : 2;
symbol_get_tc (sym)->output = 1;
symbol_get_tc (sym)->within = sym;
@@ -3150,6 +3197,14 @@ ppc_xcoff_cons (log_size)
}
static void
+ppc_machine(dummy)
+ int dummy;
+{
+ discard_rest_of_line();
+ /* What does aix use this for? */
+}
+
+static void
ppc_vbyte (dummy)
int dummy;
{
@@ -3269,7 +3324,7 @@ ppc_tc (ignore)
else
{
++input_line_pointer;
- cons (4);
+ cons ((ppc_size == PPC_OPCODE_64) ? 8 : 4);
}
}
@@ -4802,7 +4857,6 @@ md_apply_fix3 (fixp, valuep, seg)
else if ((operand->flags & PPC_OPERAND_PARENS) != 0
&& operand->bits == 16
&& operand->shift == 0
- && operand->insert == NULL
&& fixp->fx_addsy != NULL
&& ppc_is_toc_sym (fixp->fx_addsy))
{
@@ -4849,6 +4903,14 @@ md_apply_fix3 (fixp, valuep, seg)
value, 4);
break;
+ case BFD_RELOC_64:
+ if (fixp->fx_pcrel)
+ fixp->fx_r_type = BFD_RELOC_64_PCREL;
+ /* fall through */
+ case BFD_RELOC_64_PCREL:
+ md_number_to_chars (fixp->fx_frag->fr_literal + fixp->fx_where,
+ value, 8);
+ break;
case BFD_RELOC_LO16:
case BFD_RELOC_16:
case BFD_RELOC_GPREL16:
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index 783a215..8409c79 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -47,31 +47,16 @@ struct fix;
/* The target BFD architecture. */
#define TARGET_ARCH (ppc_arch ())
+#define TARGET_MACH (ppc_mach ())
extern enum bfd_architecture ppc_arch PARAMS ((void));
+extern unsigned long ppc_mach PARAMS ((void));
/* Whether or not the target is big endian */
extern int target_big_endian;
/* The target BFD format. */
-#ifdef OBJ_COFF
-#ifdef TE_PE
-#define TARGET_FORMAT (target_big_endian ? "pe-powerpc" : "pe-powerpcle")
-#else
-#define TARGET_FORMAT "aixcoff-rs6000"
-#endif
-#endif
-
-/* PowerMac has a BFD slightly different from AIX's. */
-#ifdef TE_POWERMAC
-#ifdef TARGET_FORMAT
-#undef TARGET_FORMAT
-#endif
-#define TARGET_FORMAT "xcoff-powermac"
-#endif
-
-#ifdef OBJ_ELF
-#define TARGET_FORMAT (target_big_endian ? "elf32-powerpc" : "elf32-powerpcle")
-#endif
+#define TARGET_FORMAT (ppc_target_format ())
+extern char* ppc_target_format ();
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
@@ -186,7 +171,8 @@ extern int ppc_frob_symbol PARAMS ((symbolS *));
extern void ppc_adjust_symtab PARAMS ((void));
/* Niclas Andersson <nican@ida.liu.se> says this is needed. */
-#define SUB_SEGMENT_ALIGN(SEG) 2
+extern int ppc_subseg_align PARAMS ((void));
+#define SUB_SEGMENT_ALIGN(SEG) ppc_subseg_align()
/* We also need to copy, in particular, the class of the symbol,
over what obj-coff would otherwise have copied. */