diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-21 06:51:32 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-21 06:51:32 +0000 |
commit | 68491c12179f963b346aa4cb8e1b924184d79970 (patch) | |
tree | b1c556d30ff436e16f321632a9ac977532824adf /lib/CodeGen/ELFCodeEmitter.cpp | |
parent | 634d61b13500764a506100eb5115b1afe1e427eb (diff) | |
download | external_llvm-68491c12179f963b346aa4cb8e1b924184d79970.zip external_llvm-68491c12179f963b346aa4cb8e1b924184d79970.tar.gz external_llvm-68491c12179f963b346aa4cb8e1b924184d79970.tar.bz2 |
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
Diffstat (limited to 'lib/CodeGen/ELFCodeEmitter.cpp')
-rw-r--r-- | lib/CodeGen/ELFCodeEmitter.cpp | 4 |
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; |