feat(asm): add RISC-V ELF relocatable object emission and SB relocation

support
This commit is contained in:
2026-08-03 08:51:00 +02:00
parent 7721353d44
commit f41a86b660
8 changed files with 824 additions and 43 deletions
+7 -2
View File
@@ -398,10 +398,15 @@ func parseAddress(g []token.Token) ast.Address {
return addr
}
// Symbol-with-pseudo form: name[<>][+off](PSEUDO).
// When the prefix is not a valid symbol name (e.g. a bare number like
// 0(SP) in RISC-V), sym is nil and we fall through to regular memory
// operand parsing instead of returning an empty address.
if idx := findPseudoParen(g); idx >= 0 {
sym, _ := parseSymbolPrefix(g[:idx+3])
addr.Sym = sym
return addr
if sym != nil {
addr.Sym = sym
return addr
}
}
i := 0