aboutsummaryrefslogtreecommitdiffhomepage
path: root/x86_64/emit.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-02-22 19:05:52 +0100
committerlemon <lsof@mailbox.org>2026-02-22 19:05:52 +0100
commitc13e1ec500a8a7ce6d41f0610ee1e71da50bb3b7 (patch)
tree2a7050320918656c5d9521f258d8e1703039a35d /x86_64/emit.c
parent975d76cfc99fcf797ebe0ac254dd3252405bd778 (diff)
driver: recognize shared libraries; & backend: misc fixes for PIC isel edgecases
Diffstat (limited to 'x86_64/emit.c')
-rw-r--r--x86_64/emit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/x86_64/emit.c b/x86_64/emit.c
index 0d7b77a..e54b7dd 100644
--- a/x86_64/emit.c
+++ b/x86_64/emit.c
@@ -880,7 +880,7 @@ gencopy(uchar **pcode, enum irclass cls, struct block *blk, int curi, struct ope
/* dst = 0 -> xor dst, dst; but only if it is ok to clobber flags */
Xxor(pcode, kisint(cls) ? KI32 : cls, dst, dst);
} else if (isaddrcon(val,0)) {
- if ((ccopt.pic || (contab.p[val.i].flag & SFUNC)) && !(contab.p[val.i].flag & SLOCAL)) {
+ if ((ccopt.pic || (contab.p[val.i].flag & SFUNC)) && (contab.p[val.i].flag & (SLOCAL|SFUNC)) != (SLOCAL|SFUNC)) {
GOTLoad:
/* for mov reg, [rip(sym@GOTPCREL)] */
Xmov(pcode, cls, dst, mkoper(OSYMGOT, .con = val.i, .cindex = NOINDEX));