From df0997ab048e96d65817ae719a93a35c432dabbd Mon Sep 17 00:00:00 2001 From: Alessandro Di Federico Date: Tue, 12 Jan 2016 18:06:40 +0100 Subject: [PATCH] Ensure existence of abort since the beginning --- codegenerator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codegenerator.cpp b/codegenerator.cpp index a3e86e777..34df6f84e 100644 --- a/codegenerator.cpp +++ b/codegenerator.cpp @@ -73,6 +73,11 @@ CodeGenerator::CodeGenerator(std::string Input, BinaryHandle = std::move(BinaryOrErr.get()); + // Provide an abort declaration + TheModule->getOrInsertFunction("abort", + FunctionType::get(Type::getVoidTy(Context), + false)); + // We only support ELF for now auto *TheBinary = cast(BinaryHandle.getBinary());