aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2002-10-13 21:22:49 +0000
committerAlexandre Oliva <aoliva@redhat.com>2002-10-13 21:22:49 +0000
commit10181a0dce686bb01df699b50899dde238245c2d (patch)
treeff0aa374bebc7ec458335039eeff63f9c06a87f5 /gas
parentbce03d3da87e892ff24475217dd76c4d0c18f8c2 (diff)
downloadgdb-10181a0dce686bb01df699b50899dde238245c2d.zip
gdb-10181a0dce686bb01df699b50899dde238245c2d.tar.gz
gdb-10181a0dce686bb01df699b50899dde238245c2d.tar.bz2
* config/tc-mips.c (s_gpdword): New function.
(mips_pseudo_table): Add .gpdword. (mips_need_elf_addend_fixup): never for NEWABI. (md_apply_fix3): Don't mark BFD_RELOC64 after GPREL16 or GPREL32 as done. (s_cpadd): Generate .cpadd on NEWABI.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/config/tc-mips.c54
2 files changed, 60 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ab8f584..484556d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-13 Eric Christopher <echristo@redhat.com>, Alexandre Oliva <aoliva@redhat.com>
+
+ * config/tc-mips.c (s_gpdword): New function.
+ (mips_pseudo_table): Add .gpdword.
+ (mips_need_elf_addend_fixup): never for NEWABI.
+ (md_apply_fix3): Don't mark BFD_RELOC64 after GPREL16 or
+ GPREL32 as done.
+ (s_cpadd): Generate .cpadd on NEWABI.
+
2002-10-12 Elias Athanasopoulos <eathan@otenet.gr>
* config/tc-ppc.c (ppc_cleanup): Make 'i' unsigned int.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 45a27fc..5a30e51 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -860,6 +860,7 @@ static void s_cprestore PARAMS ((int));
static void s_cpreturn PARAMS ((int));
static void s_gpvalue PARAMS ((int));
static void s_gpword PARAMS ((int));
+static void s_gpdword PARAMS ((int));
static void s_cpadd PARAMS ((int));
static void s_insn PARAMS ((int));
static void md_obj_begin PARAMS ((void));
@@ -961,6 +962,7 @@ static const pseudo_typeS mips_pseudo_table[] =
{"cpreturn", s_cpreturn, 0},
{"gpvalue", s_gpvalue, 0},
{"gpword", s_gpword, 0},
+ {"gpdword", s_gpdword, 0},
{"cpadd", s_cpadd, 0},
{"insn", s_insn, 0},
@@ -11105,6 +11107,9 @@ md_apply_fix3 (fixP, valP, seg)
/* We are not done if this is a composite relocation to set up gp. */
if (fixP->fx_addsy == NULL && ! fixP->fx_pcrel
&& !(fixP->fx_r_type == BFD_RELOC_MIPS_SUB
+ || (fixP->fx_r_type == BFD_RELOC_64
+ && (previous_fx_r_type == BFD_RELOC_GPREL32
+ || previous_fx_r_type == BFD_RELOC_GPREL16))
|| (previous_fx_r_type == BFD_RELOC_MIPS_SUB
&& (fixP->fx_r_type == BFD_RELOC_HI16_S
|| fixP->fx_r_type == BFD_RELOC_LO16))))
@@ -12303,6 +12308,50 @@ s_gpword (ignore)
demand_empty_rest_of_line ();
}
+static void
+s_gpdword (ignore)
+ int ignore ATTRIBUTE_UNUSED;
+{
+ symbolS *label;
+ expressionS ex;
+ char *p;
+
+ /* When not generating PIC code, this is treated as .dword. */
+ if (mips_pic != SVR4_PIC)
+ {
+ s_cons (3);
+ return;
+ }
+
+ label = insn_labels != NULL ? insn_labels->label : NULL;
+ mips_emit_delays (true);
+ if (auto_align)
+ mips_align (3, 0, label);
+ mips_clear_insn_labels ();
+
+ expression (&ex);
+
+ if (ex.X_op != O_symbol || ex.X_add_number != 0)
+ {
+ as_bad (_("Unsupported use of .gpdword"));
+ ignore_rest_of_line ();
+ }
+
+ p = frag_more (8);
+ md_number_to_chars (p, (valueT) 0, 8);
+ fix_new_exp (frag_now, p - frag_now->fr_literal, 8, &ex, false,
+ BFD_RELOC_GPREL32);
+
+ /* GPREL32 composed with 64 gives a 64-bit GP offset. */
+ ex.X_op = O_absent;
+ ex.X_add_symbol = 0;
+ ex.X_add_number = 0;
+ fix_new_exp (frag_now, p - frag_now->fr_literal, 8, &ex, false,
+ BFD_RELOC_64);
+
+ demand_empty_rest_of_line ();
+}
+
/* Handle the .cpadd pseudo-op. This is used when dealing with switch
tables in SVR4 PIC code. */
@@ -12313,9 +12362,8 @@ s_cpadd (ignore)
int icnt = 0;
int reg;
- /* This is ignored when not generating SVR4 PIC code or if this is NewABI
- code. */
- if (mips_pic != SVR4_PIC || HAVE_NEWABI)
+ /* This is ignored when not generating SVR4 PIC code. */
+ if (mips_pic != SVR4_PIC)
{
s_ignore (0);
return;