mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Correctly handle references to section symbols.
When processing assembly like .long .text we were creating a new undefined symbol .text. GAS on the other hand would handle that as a reference to the .text section. This patch implements that by creating the section symbols earlier so that they are visible during asm parsing. The patch also updates llvm-readobj to print the symbol number in the relocation dump so that the test can differentiate between two sections with the same name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -73,6 +73,10 @@ namespace llvm {
|
||||
/// Symbols - Bindings of names to symbols.
|
||||
SymbolTable Symbols;
|
||||
|
||||
/// ELF sections can have a corresponding symbol. This maps one to the
|
||||
/// other.
|
||||
DenseMap<const MCSectionELF*, MCSymbol*> SectionSymbols;
|
||||
|
||||
/// A maping from a local label number and an instance count to a symbol.
|
||||
/// For example, in the assembly
|
||||
/// 1:
|
||||
@@ -231,6 +235,8 @@ namespace llvm {
|
||||
MCSymbol *GetOrCreateSymbol(StringRef Name);
|
||||
MCSymbol *GetOrCreateSymbol(const Twine &Name);
|
||||
|
||||
MCSymbol *getOrCreateSectionSymbol(const MCSectionELF &Section);
|
||||
|
||||
/// LookupSymbol - Get the symbol for \p Name, or null.
|
||||
MCSymbol *LookupSymbol(StringRef Name) const;
|
||||
MCSymbol *LookupSymbol(const Twine &Name) const;
|
||||
|
Reference in New Issue
Block a user