Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/liboslexec/llvm_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,22 @@ class LLVM_Util::MemoryManager final : public LLVMMemoryManager {
return mm->allocateDataSection(Size, Alignment, SectionID, SectionName,
IsReadOnly);
}
void registerEHFrames(uint8_t* Addr, uint64_t LoadAddr,
size_t Size) override

// This memory manager is only used during JIT, where it is unnecessary to
// register EH frames in the process, as the generated code is not being
// executed yet. On certain platforms registering EH frames could lead to
// crashes due to a bug in libgcc:
//
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119151
//
// For example, the crash can be observed on Ubuntu 24.04 which is shipped
// with the affected version of libgcc. To side-step the crash, simply do
// not register EH frames as they are not needed during JIT.
void registerEHFrames(uint8_t* /*Addr*/, uint64_t /*LoadAddr*/,
size_t /*Size*/) override
{
mm->registerEHFrames(Addr, LoadAddr, Size);
}
void deregisterEHFrames() override { mm->deregisterEHFrames(); }
void deregisterEHFrames() override {}

uint64_t getSymbolAddress(const std::string& Name) override
{
Expand Down
Loading