aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/ELFCodeEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/ELFCodeEmitter.cpp')
-rw-r--r--lib/CodeGen/ELFCodeEmitter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/ELFCodeEmitter.cpp b/lib/CodeGen/ELFCodeEmitter.cpp
index 23210fc..c77334a 100644
--- a/lib/CodeGen/ELFCodeEmitter.cpp
+++ b/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;