For relocation types that are known to not require stub functions, there
is no need to allocate extra space for the stub functions.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Sanjoy, I'm not very familiar with all scenarios where stubs are used. Is it possible R_X86_64_PC32 relocation will need a stub?
I'm just going by reading the code (I'm not familiar with linkers in
general), but the relevant clause in
RuntimeDyldELF::processRelocationRef seems to be
} else if (RelType == ELF::R_X86_64_PC32) { Value.Addend += support::ulittle32_t::ref(computePlaceholderAddress(SectionID, Offset)); processSimpleRelocation(SectionID, Offset, RelType, Value);
and it does not seem to require stub space. In fact, from reading the
code, pretty much the only relocation for x86_64/ELF that needs stub
space is ELF::R_X86_64_PLT32.
In any case, if I'm wrong, D14674 and D14675 should make it obvious an
obvious crash.
Hi Sanjoy,
Sorry for the delay in reviewing this - I'm still out on vacation for another week.
I think relocationNeedsStub should be a virtual function so that we don't need to check relocations for other formats/archs, but other than that this looks good to me. :)
Cheers,
Lang.