[llvm-commits] [llvm] r116848 - /llvm/trunk/lib/MC/ELFObjectWriter.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Oct 19 12:31:38 PDT 2010
Author: rafael
Date: Tue Oct 19 14:31:37 2010
New Revision: 116848
URL: http://llvm.org/viewvc/llvm-project?rev=116848&view=rev
Log:
Small cleanups and fixes in preparation for fixing _GLOBAL_OFFSET_TABLE_.
Modified:
llvm/trunk/lib/MC/ELFObjectWriter.cpp
Modified: llvm/trunk/lib/MC/ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/ELFObjectWriter.cpp?rev=116848&r1=116847&r2=116848&view=diff
==============================================================================
--- llvm/trunk/lib/MC/ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/ELFObjectWriter.cpp Tue Oct 19 14:31:37 2010
@@ -703,9 +703,16 @@
// instead?
case X86::reloc_signed_4byte:
case X86::reloc_pcrel_4byte:
+ case FK_Data_4:
switch (Modifier) {
default:
llvm_unreachable("Unimplemented");
+ case MCSymbolRefExpr::VK_None:
+ if (Symbol->getName() == "_GLOBAL_OFFSET_TABLE_")
+ Type = ELF::R_386_GOTPC;
+ else
+ Type = ELF::R_386_32;
+ break;
case MCSymbolRefExpr::VK_GOT:
Type = ELF::R_386_GOT32;
break;
@@ -714,12 +721,6 @@
break;
}
break;
- case FK_Data_4:
- if (Symbol->getName() == "_GLOBAL_OFFSET_TABLE_")
- Type = ELF::R_386_GOTPC;
- else
- Type = ELF::R_386_32;
- break;
case FK_Data_2: Type = ELF::R_386_16; break;
case X86::reloc_pcrel_1byte:
case FK_Data_1: Type = ELF::R_386_8; break;
@@ -761,11 +762,14 @@
static bool isInSymtab(const MCAssembler &Asm, const MCSymbolData &Data,
bool Used) {
+ if (Used)
+ return true;
+
const MCSymbol &Symbol = Data.getSymbol();
if (!Asm.isSymbolLinkerVisible(Symbol) && !Symbol.isUndefined())
return false;
- if (!Used && Symbol.isTemporary())
+ if (Symbol.isTemporary())
return false;
return true;
More information about the llvm-commits
mailing list