mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-05 12:31:46 +00:00
Produce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have a
VK_GOTOFF reloc. This matches as' behavior, but it is not clear why the linker might need this, so I added a FIXME. I could test this by duplicating test/MC/ELF/got.s, but it doesn't look worthwhile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132655 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f1282d9cb
commit
378e0ecf24
@ -62,6 +62,7 @@ bool ELFObjectWriter::RelocNeedsGOT(MCSymbolRefExpr::VariantKind Variant) {
|
|||||||
case MCSymbolRefExpr::VK_GOT:
|
case MCSymbolRefExpr::VK_GOT:
|
||||||
case MCSymbolRefExpr::VK_PLT:
|
case MCSymbolRefExpr::VK_PLT:
|
||||||
case MCSymbolRefExpr::VK_GOTPCREL:
|
case MCSymbolRefExpr::VK_GOTPCREL:
|
||||||
|
case MCSymbolRefExpr::VK_GOTOFF:
|
||||||
case MCSymbolRefExpr::VK_TPOFF:
|
case MCSymbolRefExpr::VK_TPOFF:
|
||||||
case MCSymbolRefExpr::VK_TLSGD:
|
case MCSymbolRefExpr::VK_TLSGD:
|
||||||
case MCSymbolRefExpr::VK_GOTTPOFF:
|
case MCSymbolRefExpr::VK_GOTTPOFF:
|
||||||
@ -556,6 +557,7 @@ void ELFObjectWriter::ComputeSymbolTable(MCAssembler &Asm,
|
|||||||
RevGroupMapTy RevGroupMap,
|
RevGroupMapTy RevGroupMap,
|
||||||
unsigned NumRegularSections) {
|
unsigned NumRegularSections) {
|
||||||
// FIXME: Is this the correct place to do this?
|
// FIXME: Is this the correct place to do this?
|
||||||
|
// FIXME: Why is an undefined reference to _GLOBAL_OFFSET_TABLE_ needed?
|
||||||
if (NeedsGOT) {
|
if (NeedsGOT) {
|
||||||
llvm::StringRef Name = "_GLOBAL_OFFSET_TABLE_";
|
llvm::StringRef Name = "_GLOBAL_OFFSET_TABLE_";
|
||||||
MCSymbol *Sym = Asm.getContext().GetOrCreateSymbol(Name);
|
MCSymbol *Sym = Asm.getContext().GetOrCreateSymbol(Name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user