diff options
| author | 2026-03-23 23:38:53 +0100 | |
|---|---|---|
| committer | 2026-03-23 23:43:52 +0100 | |
| commit | 62d995124c0cc2eaeec79e18edc3e044f3e524c9 (patch) | |
| tree | 4c79a80efca09f8050109aa0440ec75351d72c17 /src/t_x86-64_emit.c | |
| parent | 8630aeb8b43c507cd00f5b091ddcee4def464f4d (diff) | |
IR: emit inline function standalone bodies lazily
If a function is stashed for inlining and inlined in all of its
callsites or unused, it never ends up in the object file. If any symbol
reference to it is emitted, then it must be de-inlined (rematerialized),
and this is done near the end before emitting the actual object file.
Diffstat (limited to 'src/t_x86-64_emit.c')
| -rw-r--r-- | src/t_x86-64_emit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/t_x86-64_emit.c b/src/t_x86-64_emit.c index 9224d4b..0da27d8 100644 --- a/src/t_x86-64_emit.c +++ b/src/t_x86-64_emit.c @@ -358,7 +358,7 @@ encode(uchar **pcode, const EncDesc *tab, int ntab, enum irclass k, Oper dst, Op } else { enum relockind r = REL_PCREL32; if (mem.t == OSYMGOT) r = rex ? REL_GOTPCRELX_REX : REL_GOTPCRELX; - objreloc(xcon2sym(mem.con), r, Stext, *pcode - objout.textbegin, disp); + objrelocxcon(mem.con, r, Stext, *pcode - objout.textbegin, disp); I32(0); } } else { @@ -366,7 +366,7 @@ encode(uchar **pcode, const EncDesc *tab, int ntab, enum irclass k, Oper dst, Op assert(!ccopt.pic && !ccopt.pie && "cannot encode [RIP-rel + REG] for position independent"); B(/*mod 0*/ (reg & 7) << 3 | RSP); B(mem.cshift << 6 | ((mem.cindex & 7) << 3) | RBP); /* SIB [index*s + disp32] */ - objreloc(xcon2sym(mem.con), REL_ABS32S, Stext, *pcode - objout.textbegin, mem.disp); + objrelocxcon(mem.con, REL_ABS32S, Stext, *pcode - objout.textbegin, mem.disp); I32(0); } } else { @@ -455,7 +455,7 @@ encode(uchar **pcode, const EncDesc *tab, int ntab, enum irclass k, Oper dst, Op I32(addr - (*pcode - objout.textbegin) - 4); } else { enum relockind r = (ccopt.pie|ccopt.pic) ? REL_PLT32 : REL_PCREL32; - objreloc(sym, r, Stext, *pcode - objout.textbegin, -4); + objrelocxcon(dst.con, r, Stext, *pcode - objout.textbegin, -4); I32(0); } break; |