diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-01-25 00:24:57 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-01-25 00:24:57 +0000 |
commit | 425625680ac18dd85dfdcc3e65ff51f99d8e5e6e (patch) | |
tree | 70a9c3e1a9c5d92393c88e3cedab72e6d04c8393 /gas | |
parent | 0cafaab1f06f56a9cf47646bdeb8d56993b84d75 (diff) | |
download | gdb-425625680ac18dd85dfdcc3e65ff51f99d8e5e6e.zip gdb-425625680ac18dd85dfdcc3e65ff51f99d8e5e6e.tar.gz gdb-425625680ac18dd85dfdcc3e65ff51f99d8e5e6e.tar.bz2 |
* tc-mips.c (g_switch_seen): New static variable.
(md_parse_option): Set g_switch_seen for -G option.
(s_option): If creating PIC code, force the GP size to be 0. Warn
if -G switch used with a non-zero value.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-mips.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 36e7850..e779ed0 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -113,6 +113,8 @@ static int mips_nobopt; #ifdef GPOPT /* The size of the small data section. */ static int g_switch_value = 8; +/* Whether the -G option was used. */ +static int g_switch_seen = 0; #endif #define N_RMASK 0xc4 @@ -4684,6 +4686,7 @@ md_parse_option (argP, cntP, vecP) } else as_warn ("Number expected after -G"); + g_switch_seen = 1; *argP = ""; return 1; } @@ -5120,6 +5123,14 @@ s_option (x) mips_pic = atoi (opt + 3); /* Supposedly no other values are used. */ assert (mips_pic == 0 || mips_pic == 2); + + if (mips_pic == 2) + { + if (g_switch_seen && g_switch_value != 0) + as_warn ("-G may not be used with PIC code"); + g_switch_value = 0; + bfd_set_gp_size (stdoutput, 0); + } } else as_warn ("Unrecognized option \"%s\"", opt); |