Skip to content

Commit 237e765

Browse files
jrtc27resistor
authored andcommitted
[ELF][CHERI] Set non-zero size for IFUNC canonical PLT on CHERI
1 parent b813360 commit 237e765

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lld/ELF/Relocations.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1952,7 +1952,10 @@ static bool handleNonPreemptibleIfunc(Ctx &ctx, Symbol &sym, uint16_t flags) {
19521952
auto &d = cast<Defined>(sym);
19531953
d.section = ctx.in.iplt.get();
19541954
d.value = d.getPltIdx(ctx) * ctx.target->ipltEntrySize;
1955-
d.setSize(0);
1955+
if (ctx.arg.isCheriAbi)
1956+
d.setSize(ctx.target->ipltEntrySize);
1957+
else
1958+
d.setSize(0);
19561959
// It's important to set the symbol type here so that dynamic loaders
19571960
// don't try to call the PLT as if it were an ifunc resolver.
19581961
d.type = STT_FUNC;

0 commit comments

Comments
 (0)