Skip to content

Commit cf3cabd

Browse files
committed
[ELF][CHERI] Set non-zero size for IFUNC canonical PLT on CHERI
1 parent e9bf108 commit cf3cabd

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
@@ -1712,7 +1712,10 @@ static bool handleNonPreemptibleIfunc(Symbol &sym, uint16_t flags) {
17121712
auto &d = cast<Defined>(sym);
17131713
d.section = in.iplt.get();
17141714
d.value = d.getPltIdx() * target->ipltEntrySize;
1715-
d.setSize(0);
1715+
if (config->isCheriAbi)
1716+
d.setSize(target->ipltEntrySize);
1717+
else
1718+
d.setSize(0);
17161719
// It's important to set the symbol type here so that dynamic loaders
17171720
// don't try to call the PLT as if it were an ifunc resolver.
17181721
d.type = STT_FUNC;

0 commit comments

Comments
 (0)