From c13e1ec500a8a7ce6d41f0610ee1e71da50bb3b7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 22 Feb 2026 19:05:52 +0100 Subject: driver: recognize shared libraries; & backend: misc fixes for PIC isel edgecases --- x86_64/emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'x86_64/emit.c') 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)); -- cgit v1.2.3