We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ec0e6f commit b39cbc7Copy full SHA for b39cbc7
riscv64-asm.c
@@ -209,6 +209,16 @@ static void parse_operand(TCCState *s1, Operand *op)
209
if ((int) op->e.v >= -0x1000 && (int) op->e.v < 0x1000)
210
op->type = OP_IM12S;
211
} else if (op->e.sym->type.t & (VT_EXTERN | VT_STATIC)) {
212
+ /* see also: "RISC-V ABIs Specification" V1.0
213
+
214
+ section 5.2 recommends using a GOT for
215
+ "possibly-undefined weak symbols"
216
217
+ section 5.3: "Medium position independent code model"
218
+ if this is a non-local symbol: use a GOT
219
+ non-local: outside of a pc-relative +- 2 GiB range
220
+ */
221
222
label.type.t = VT_VOID | VT_STATIC;
223
224
/* use the medium PIC model: GOT, auipc, lw */
0 commit comments