[llvm] ff4fd8d - [ORC] Make sure we add initializers to the SymbolFlags map for objects.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 09:33:53 PST 2020
Author: Lang Hames
Date: 2020-03-03T09:33:37-08:00
New Revision: ff4fd8dead8fa1068dffff1564da90e3c077dd8c
URL: https://github.com/llvm/llvm-project/commit/ff4fd8dead8fa1068dffff1564da90e3c077dd8c
DIFF: https://github.com/llvm/llvm-project/commit/ff4fd8dead8fa1068dffff1564da90e3c077dd8c.diff
LOG: [ORC] Make sure we add initializers to the SymbolFlags map for objects.
Added:
llvm/test/ExecutionEngine/JITLink/X86/MachO_initializers.s
Modified:
llvm/lib/ExecutionEngine/Orc/Mangling.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/Mangling.cpp b/llvm/lib/ExecutionEngine/Orc/Mangling.cpp
index 7ec7869d00b5..0f73eff0be31 100644
--- a/llvm/lib/ExecutionEngine/Orc/Mangling.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/Mangling.cpp
@@ -119,6 +119,7 @@ getObjectSymbolInfo(ExecutionSession &ES, MemoryBufferRef ObjBuffer) {
raw_string_ostream(InitSymString)
<< "$." << ObjBuffer.getBufferIdentifier() << ".__inits";
InitSymbol = ES.intern(InitSymString);
+ SymbolFlags[InitSymbol] = JITSymbolFlags();
break;
}
}
diff --git a/llvm/test/ExecutionEngine/JITLink/X86/MachO_initializers.s b/llvm/test/ExecutionEngine/JITLink/X86/MachO_initializers.s
new file mode 100644
index 000000000000..475617dafb55
--- /dev/null
+++ b/llvm/test/ExecutionEngine/JITLink/X86/MachO_initializers.s
@@ -0,0 +1,21 @@
+# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -filetype=obj -o %t.o %s
+# RUN: llvm-jitlink -noexec %t.o
+
+ .section __TEXT,__text,regular,pure_instructions
+ .macosx_version_min 10, 14 sdk_version 10, 15
+
+ .globl _main
+_main:
+ retq
+
+ .section __TEXT,__StaticInit,regular,pure_instructions
+ .p2align 4, 0x90
+_foo:
+ retq
+
+
+ .section __DATA,__mod_init_func,mod_init_funcs
+ .p2align 3
+ .quad _foo
+
+.subsections_via_symbols
More information about the llvm-commits
mailing list