This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PR gas/5543 broke mmix: "can't equate global symbol foo with register name"
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: binutils at sourceware dot org
- Date: Sun, 5 Oct 2008 12:38:03 -0700
- Subject: Re: PR gas/5543 broke mmix: "can't equate global symbol foo with register name"
- References: <m37i9fum7p.fsf@redhat.com> <20081004202147.I40097@dair.pair.com>
On Sat, Oct 04, 2008 at 08:41:29PM -0400, Hans-Peter Nilsson wrote:
> I see:
> Running /home/hp/binutils/src/ld/testsuite/ld-mmix/mmix.exp ...
> ...
> FAIL: ld-mmix/bpo-13
> FAIL: ld-mmix/bpo-13m
> FAIL: ld-mmix/local1
> FAIL: ld-mmix/local1m
> FAIL: ld-mmix/local2
> FAIL: ld-mmix/local2m
> FAIL: ld-mmix/local5
> FAIL: ld-mmix/local5m
> FAIL: ld-mmix/reg-1
> FAIL: ld-mmix/reg-1m
>
> where entries in ld.log say e.g.:
> binutils/src/ld/testsuite/ld-mmix/areg-256.s:2: Error: can't equate global symbol `areg' with register name
>
> This used to work. cvs ann read.c shows you added the error
> message above around March 3 to fix PR gas/5543. Please fix the fix.
>
MMIX has
/* Symbol attributes. */
/* A symbol with this section-index is a register. */
#define SHN_REGISTER SHN_LOPROC
This patch allows global register symbol if GLOBAL_REGISTER_SYMBOL_OK
is defined. OK to install?
Thanks.
H.J.
----
2008-10-05 H.J. Lu <hongjiu.lu@intel.com>
* read.c (pseudo_set): Don't allow global register symbol only
if GLOBAL_REGISTER_SYMBOL_OK is undefined.
* symbols.c (S_SET_EXTERNAL): Likewise.
* config/tc-mmix.h (GLOBAL_REGISTER_SYMBOL_OK): Defined.
--- gas/config/tc-mmix.h.reg 2007-07-03 06:45:21.000000000 -0700
+++ gas/config/tc-mmix.h 2008-10-05 12:26:54.000000000 -0700
@@ -224,3 +224,6 @@ extern void mmix_md_do_align (int, char
/* This target is buggy, and sets fix size too large. */
#define TC_FX_SIZE_SLACK(FIX) 6
+
+/* MMIX has global register symbols. */
+#define GLOBAL_REGISTER_SYMBOL_OK
--- gas/read.c.reg 2008-10-05 11:10:28.000000000 -0700
+++ gas/read.c 2008-10-05 12:26:40.000000000 -0700
@@ -3604,12 +3604,14 @@ pseudo_set (symbolS *symbolP)
break;
case O_register:
+#ifndef GLOBAL_REGISTER_SYMBOL_OK
if (S_IS_EXTERNAL (symbolP))
{
as_bad ("can't equate global symbol `%s' with register name",
S_GET_NAME (symbolP));
return;
}
+#endif
S_SET_SEGMENT (symbolP, reg_section);
S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
set_zero_frag (symbolP);
--- gas/symbols.c.reg 2008-03-03 07:29:13.000000000 -0800
+++ gas/symbols.c 2008-10-05 12:26:45.000000000 -0700
@@ -2184,12 +2184,14 @@ S_SET_EXTERNAL (symbolS *s)
_("section symbols are already global"));
return;
}
+#ifndef GLOBAL_REGISTER_SYMBOL_OK
if (S_GET_SEGMENT (s) == reg_section)
{
as_bad ("can't make register symbol `%s' global",
S_GET_NAME (s));
return;
}
+#endif
s->bsym->flags |= BSF_GLOBAL;
s->bsym->flags &= ~(BSF_LOCAL | BSF_WEAK);