summaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2008-03-03 15:28:58 +0000
committerH.J. Lu <hjl@lucon.org>2008-03-03 15:28:58 +0000
commitf77561d7e9b270171afbcb60cdab8c902c0fbf4f (patch)
treedfa513b769e986b2a04ec2d1cde58e84be64ff21 /gas/write.c
parent131cd434ec81aa23718dca4bd46569ecb3349e84 (diff)
downloadbinutils-redhat-f77561d7e9b270171afbcb60cdab8c902c0fbf4f.tar.gz
gas/
2008-03-03 Denys Vlasenko <vda.linux@googlemail.com> H.J. Lu <hongjiu.lu@intel.com> PR gas/5543 * read.c (pseudo_set): Don't allow global register symbol. * symbols.c (S_SET_EXTERNAL): Don't allow register symbol global. 2008-03-03 H.J. Lu <hongjiu.lu@intel.com> PR gas/5543 * write.c (write_object_file): Don't allow symbols which were equated to register. Stop if there is an error. gas/testsuite/ 2008-03-03 H.J. Lu <hongjiu.lu@intel.com> PR gas/5543 * gas/i386/i386.exp: Run inval-equ-1 and inval-equ-2. * gas/i386/inval-equ-1.l: New. * gas/i386/inval-equ-1.s: Likewise. * gas/i386/inval-equ-2.l: Likewise. * gas/i386/inval-equ-2.s: Likewise.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gas/write.c b/gas/write.c
index 03641dfa4b..9875f7f687 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1763,6 +1763,13 @@ write_object_file (void)
as_bad (_("Local symbol `%s' can't be equated to common symbol `%s'"),
name, S_GET_NAME (e->X_add_symbol));
}
+ if (S_GET_SEGMENT (symp) == reg_section)
+ {
+ /* Report error only if we know the symbol name. */
+ if (S_GET_NAME (symp) != reg_section->name)
+ as_bad (_("can't make global register symbol `%s'"),
+ name);
+ }
symbol_remove (symp, &symbol_rootP, &symbol_lastP);
continue;
}
@@ -1830,6 +1837,10 @@ write_object_file (void)
obj_adjust_symtab ();
#endif
+ /* Stop if there is an error. */
+ if (had_errors ())
+ return;
+
/* Now that all the sizes are known, and contents correct, we can
start writing to the file. */
set_symtab ();