aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-06-06 17:16:16 +0000
committerIan Lance Taylor <ian@airs.com>1994-06-06 17:16:16 +0000
commitd2c71068e85b97ec00c86ac211aed42c686b4d24 (patch)
treed7c36145ba0c30ad6cd69a31d4986c5751db13ef /gas/config
parent30f34d07c74ca1cc7a2aae4ff58f31d8046cd9a1 (diff)
downloadgdb-d2c71068e85b97ec00c86ac211aed42c686b4d24.zip
gdb-d2c71068e85b97ec00c86ac211aed42c686b4d24.tar.gz
gdb-d2c71068e85b97ec00c86ac211aed42c686b4d24.tar.bz2
* config/tc-mips.c (RDATA_SECTION_NAME): Define.
(macro): Correct M_LI_SS SVR4_PIC/EMBEDDED_PIC case. After M_LI_D or M_L_DOB or label dob, force a new frag to avoid getting confused in tc_gen_reloc. (mips_ip): Use RDATA_SECTION_NAME, not .rdata. (s_change_sec): Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-mips.c57
1 files changed, 39 insertions, 18 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 4b6525e..0ab2cdb 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -90,6 +90,17 @@ static char *mips_regmask_frag;
const char *mips_target_format = DEFAULT_TARGET_FORMAT;
+/* The name of the readonly data section. */
+#ifdef OBJ_AOUT
+#define RDATA_SECTION_NAME ".data"
+#endif
+#ifdef OBJ_ECOFF
+#define RDATA_SECTION_NAME ".rdata"
+#endif
+#ifdef OBJ_ELF
+#define RDATA_SECTION_NAME ".rodata"
+#endif
+
/* These variables are filled in with the masks of registers used.
The object format code reads them and puts them in the appropriate
place. */
@@ -2987,17 +2998,22 @@ macro (ip)
&& offset_expr.X_add_number == 0);
macro_build ((char *) NULL, &icnt, &offset_expr, "lwc1", "T,o(b)",
treg, (int) BFD_RELOC_MIPS_LITERAL, GP);
+ return;
}
else if (mips_pic == SVR4_PIC
|| mips_pic == EMBEDDED_PIC)
{
assert (imm_expr.X_op == O_constant);
- load_register (&icnt, treg, &imm_expr);
+ load_register (&icnt, AT, &imm_expr);
+ macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
+ "mtc1", "t,G", AT, treg);
+ break;
}
else
- abort ();
-
- return;
+ {
+ abort ();
+ return;
+ }
case M_LI_D:
/* We know that sym is in the .rdata section. First we get the
@@ -3043,7 +3059,12 @@ macro (ip)
treg + 1, (int) BFD_RELOC_LO16, AT);
}
}
-
+
+ /* To avoid confusion in tc_gen_reloc, we must ensure that this
+ does not become a variant frag. */
+ frag_wane (frag_now);
+ frag_new (0);
+
break;
case M_LI_DD:
@@ -3100,6 +3121,12 @@ macro (ip)
macro_build ((char *) NULL, &icnt, &offset_expr, "lwc1", "T,o(b)",
byte_order == LITTLE_ENDIAN ? treg + 1 : treg,
(int) r, breg);
+
+ /* To avoid confusion in tc_gen_reloc, we must ensure that this
+ does not become a variant frag. */
+ frag_wane (frag_now);
+ frag_new (0);
+
if (breg != AT)
return;
break;
@@ -4478,10 +4505,12 @@ mips_ip (str, ip)
{
default: /* unused default case avoids warnings. */
case 'L':
- newname = (mips_pic != SVR4_PIC ? ".lit8" : ".rdata");
+ newname = (mips_pic != SVR4_PIC
+ ? ".lit8"
+ : RDATA_SECTION_NAME);
break;
case 'F':
- newname = ".rdata";
+ newname = RDATA_SECTION_NAME;
break;
case 'l':
assert (mips_pic == NO_PIC);
@@ -5507,13 +5536,9 @@ s_change_sec (sec)
break;
case 'r':
-#ifdef OBJ_ECOFF
- subseg_new (".rdata", (subsegT) get_absolute_expression ());
- demand_empty_rest_of_line ();
- break;
-#else /* ! defined (OBJ_ECOFF) */
+ seg = subseg_new (RDATA_SECTION_NAME,
+ (subsegT) get_absolute_expression ());
#ifdef OBJ_ELF
- seg = subseg_new (".rodata", (subsegT) get_absolute_expression ());
bfd_set_section_flags (stdoutput, seg,
(SEC_ALLOC
| SEC_LOAD
@@ -5521,13 +5546,9 @@ s_change_sec (sec)
| SEC_RELOC
| SEC_DATA));
bfd_set_section_alignment (stdoutput, seg, 4);
+#endif
demand_empty_rest_of_line ();
break;
-#else /* ! defined (OBJ_ELF) */
- s_data (0);
- break;
-#endif /* ! defined (OBJ_ELF) */
-#endif /* ! defined (OBJ_ECOFF) */
case 's':
#ifdef GPOPT