Add support to properly reference private symbols on relocation entries.
Use proper relocation type to build relocations for JumpTables (rodata
sections).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76326 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h
index ee5a856..89ab00c 100644
--- a/lib/CodeGen/ELFWriter.h
+++ b/lib/CodeGen/ELFWriter.h
@@ -107,8 +107,8 @@
std::map<std::string, ELFSection*> SectionLookup;
/// GblSymLookup - This is a mapping from global value to a symbol index
- /// in the symbol table. This is useful since relocations symbol references
- /// must be quickly mapped to a symbol table index
+ /// in the symbol table or private symbols list. This is useful since reloc
+ /// symbol references must be quickly mapped to their indices on the lists
std::map<const GlobalValue*, uint32_t> GblSymLookup;
/// SymbolList - This is the list of symbols emitted to the symbol table.
@@ -116,6 +116,10 @@
/// the beginning while non-locals at the end.
std::vector<ELFSym*> SymbolList;
+ /// PrivateSyms - Record private symbols, every symbol here must never be
+ /// present in the SymbolList.
+ std::vector<ELFSym*> PrivateSyms;
+
/// PendingGlobals - List of externally defined symbols that we have been
/// asked to emit, but have not seen a reference to. When a reference
/// is seen, the symbol will move from this list to the SymbolList.