mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-18 11:03:27 +08:00
i386-asm: fix pc-relative label ariths
See test. We need to use 'ind' from later when the address field of the instruction is put. Also: fix crash when the substracted symbol is undefined Also: assume asm-symbols to be lvalues (except func/array)
This commit is contained in:
@@ -487,7 +487,7 @@ ST_FUNC void gen_expr32(ExprValue *pe)
|
||||
if (pe->pcrel)
|
||||
/* If PC-relative, always set VT_SYM, even without symbol,
|
||||
so as to force a relocation to be emitted. */
|
||||
gen_addrpc32(VT_SYM, pe->sym, pe->v);
|
||||
gen_addrpc32(VT_SYM, pe->sym, pe->v + (ind + 4));
|
||||
else
|
||||
gen_addr32(pe->sym ? VT_SYM : 0, pe->sym, pe->v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user