shithub: scc

Download patch

ref: 48b3decbbe158d8d164cacfc4a7af81ee4b6e847
parent: 66269665be3e744d8b94b52b2aa4dcb9158ce59b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Dec 12 16:21:15 EST 2017

[as] Don't define relocatable symbols

We were defining all the symbols in the seconds pass, but this was an
error because relocatable symbols don't have an actual address yet.

--- a/as/symbol.c
+++ b/as/symbol.c
@@ -135,7 +135,8 @@
 	sym = lookup(name, FUNDEF);
 	if (pass == 1 && (sym->flags & FUNDEF) == 0)
 		error("redefinition of label '%s'", name);
-	sym->flags &= ~FUNDEF;
+	if (cursec->flags & SABS)
+		sym->flags &= ~FUNDEF;
 	sym->value = cursec->curpc;
 
 	if (*name != '.')