From 68491c12179f963b346aa4cb8e1b924184d79970 Mon Sep 17 00:00:00 2001 From: Bruno Cardoso Lopes Date: Tue, 21 Jul 2009 06:51:32 +0000 Subject: Support adding relocations for data sections, handling the cases where global declared symbols are initialized with references from other global symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76540 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/ELFCodeEmitter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen/ELFCodeEmitter.cpp') 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; -- cgit v1.1