aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog11
-rw-r--r--gas/config/tc-mips.c37
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/mips/call-nonpic-1.d16
-rw-r--r--gas/testsuite/gas/mips/call-nonpic-1.s2
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
6 files changed, 60 insertions, 12 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a62f032..da59bd8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,14 @@
+2008-08-08 Richard Sandiford <rdsandiford@googlemail.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * config/tc-mips.c (OPTION_CALL_NONPIC): New macro.
+ (OPTION_NON_SHARED, OPTION_XGOT, OPTION_MABI, OPTION_32)
+ (OPTION_N32, OPTION_64, OPTION_MDEBUG, OPTION_NO_MDEBUG)
+ (OPTION_PDR, OPTION_NO_PDR, OPTION_MVXWORKS_PIC): Bump by 1.
+ (md_longopts): Add -call_nonpic.
+ (md_parse_option): Handle OPTION_CALL_NONPIC.
+ (md_show_usage): Add -call_nonpic.
+
2008-08-08 Sterling Augustine <sterling@tensilica.com>
* config/tc-xtensa.c (exclude_section_from_property_tables): New.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index c03cca2..f55961b 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -11231,27 +11231,29 @@ struct option md_longopts[] =
#define OPTION_CALL_SHARED (OPTION_ELF_BASE + 0)
{"KPIC", no_argument, NULL, OPTION_CALL_SHARED},
{"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
-#define OPTION_NON_SHARED (OPTION_ELF_BASE + 1)
+#define OPTION_CALL_NONPIC (OPTION_ELF_BASE + 1)
+ {"call_nonpic", no_argument, NULL, OPTION_CALL_NONPIC},
+#define OPTION_NON_SHARED (OPTION_ELF_BASE + 2)
{"non_shared", no_argument, NULL, OPTION_NON_SHARED},
-#define OPTION_XGOT (OPTION_ELF_BASE + 2)
+#define OPTION_XGOT (OPTION_ELF_BASE + 3)
{"xgot", no_argument, NULL, OPTION_XGOT},
-#define OPTION_MABI (OPTION_ELF_BASE + 3)
+#define OPTION_MABI (OPTION_ELF_BASE + 4)
{"mabi", required_argument, NULL, OPTION_MABI},
-#define OPTION_32 (OPTION_ELF_BASE + 4)
+#define OPTION_32 (OPTION_ELF_BASE + 5)
{"32", no_argument, NULL, OPTION_32},
-#define OPTION_N32 (OPTION_ELF_BASE + 5)
+#define OPTION_N32 (OPTION_ELF_BASE + 6)
{"n32", no_argument, NULL, OPTION_N32},
-#define OPTION_64 (OPTION_ELF_BASE + 6)
+#define OPTION_64 (OPTION_ELF_BASE + 7)
{"64", no_argument, NULL, OPTION_64},
-#define OPTION_MDEBUG (OPTION_ELF_BASE + 7)
+#define OPTION_MDEBUG (OPTION_ELF_BASE + 8)
{"mdebug", no_argument, NULL, OPTION_MDEBUG},
-#define OPTION_NO_MDEBUG (OPTION_ELF_BASE + 8)
+#define OPTION_NO_MDEBUG (OPTION_ELF_BASE + 9)
{"no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG},
-#define OPTION_PDR (OPTION_ELF_BASE + 9)
+#define OPTION_PDR (OPTION_ELF_BASE + 10)
{"mpdr", no_argument, NULL, OPTION_PDR},
-#define OPTION_NO_PDR (OPTION_ELF_BASE + 10)
+#define OPTION_NO_PDR (OPTION_ELF_BASE + 11)
{"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
-#define OPTION_MVXWORKS_PIC (OPTION_ELF_BASE + 11)
+#define OPTION_MVXWORKS_PIC (OPTION_ELF_BASE + 12)
{"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
#endif /* OBJ_ELF */
@@ -11515,6 +11517,16 @@ md_parse_option (int c, char *arg)
mips_abicalls = TRUE;
break;
+ case OPTION_CALL_NONPIC:
+ if (!IS_ELF)
+ {
+ as_bad (_("-call_nonpic is supported only for ELF format"));
+ return 0;
+ }
+ mips_pic = NO_PIC;
+ mips_abicalls = TRUE;
+ break;
+
case OPTION_NON_SHARED:
if (!IS_ELF)
{
@@ -15401,8 +15413,9 @@ MIPS options:\n\
#ifdef OBJ_ELF
fprintf (stream, _("\
-KPIC, -call_shared generate SVR4 position independent code\n\
+-call_nonpic generate non-PIC code that can operate with DSOs\n\
-mvxworks-pic generate VxWorks position independent code\n\
--non_shared do not generate position independent code\n\
+-non_shared do not generate code that can operate with DSOs\n\
-xgot assume a 32 bit GOT\n\
-mpdr, -mno-pdr enable/disable creation of .pdr sections\n\
-mshared, -mno-shared disable/enable .cpload optimization for\n\
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index e75b7cf..2dc0d38 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2008-08-08 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * gas/mips/call-nonpic-1.s, gas/mips/call-nonpic-1.d: New test.
+ * gas/mips/mips.exp: Run it.
+
2008-08-06 Richard Sandiford <rdsandiford@googlemail.com>
* gas/mips/elf-rel8-mips16.d, gas/mips/elf-rel8-mips16.s,
diff --git a/gas/testsuite/gas/mips/call-nonpic-1.d b/gas/testsuite/gas/mips/call-nonpic-1.d
new file mode 100644
index 0000000..61d2b09
--- /dev/null
+++ b/gas/testsuite/gas/mips/call-nonpic-1.d
@@ -0,0 +1,16 @@
+#as: -mabi=32 -mips2 -call_nonpic
+#objdump: -pdr
+
+.*
+private flags = 10001004: .*
+
+
+Disassembly of section \.text:
+
+0+0 <\.text>:
+.* lui t9,0x0
+.*: R_MIPS_HI16 foo
+.* addiu t9,t9,0
+.*: R_MIPS_LO16 foo
+.* jalr t9
+.* nop
diff --git a/gas/testsuite/gas/mips/call-nonpic-1.s b/gas/testsuite/gas/mips/call-nonpic-1.s
new file mode 100644
index 0000000..27239d4
--- /dev/null
+++ b/gas/testsuite/gas/mips/call-nonpic-1.s
@@ -0,0 +1,2 @@
+ la $25,foo
+ jalr $25
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 3c4a919..a037a99 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -832,4 +832,5 @@ if { [istarget mips*-*-vxworks*] } {
[mips_arch_list_matching mips1]
run_dump_test "mips16-vis-1"
+ run_dump_test "call-nonpic-1"
}