mirror of
git://repo.or.cz/tinycc.git
synced 2026-07-03 09:58:41 +08:00
riscv64-asm.c: parse_operand: document some ABI details
This commit is contained in:
parent
5ec0e6f84b
commit
b39cbc70c4
@ -209,6 +209,16 @@ static void parse_operand(TCCState *s1, Operand *op)
|
|||||||
if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000)
|
if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000)
|
||||||
op->type = OP_IM12S;
|
op->type = OP_IM12S;
|
||||||
} else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) {
|
} else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) {
|
||||||
|
/* see also: "RISC-V ABIs Specification" V1.0
|
||||||
|
|
||||||
|
section 5.2 recommends using a GOT for
|
||||||
|
"possibly-undefined weak symbols"
|
||||||
|
|
||||||
|
section 5.3: "Medium position independent code model"
|
||||||
|
if this is a non-local symbol: use a GOT
|
||||||
|
non-local: outside of a pc-relative +- 2 GiB range
|
||||||
|
*/
|
||||||
|
|
||||||
label.type.t = VT_VOID | VT_STATIC;
|
label.type.t = VT_VOID | VT_STATIC;
|
||||||
|
|
||||||
/* use the medium PIC model: GOT, auipc, lw */
|
/* use the medium PIC model: GOT, auipc, lw */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user