summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/ELFCodeEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/ELFCodeEmitter.cpp')
-rw-r--r--llvm/lib/CodeGen/ELFCodeEmitter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ELFCodeEmitter.cpp b/llvm/lib/CodeGen/ELFCodeEmitter.cpp
index 23210fcbc70..c77334aa289 100644
--- a/llvm/lib/CodeGen/ELFCodeEmitter.cpp
+++ b/llvm/lib/CodeGen/ELFCodeEmitter.cpp
@@ -68,6 +68,10 @@ bool ELFCodeEmitter::finishFunction(MachineFunction &MF) {
FnSym->SectionIdx = ES->SectionIdx;
FnSym->Size = ES->getCurrentPCOffset()-FnStartOff;
+ // keep track of the emitted function leaving its symbol index as zero
+ // to be patched up later when emitting the symbol table
+ EW.setGlobalSymLookup(F, 0);
+
// Offset from start of Section
FnSym->Value = FnStartOff;
OpenPOWER on IntegriCloud