Behave a bit more like gnu as and use the symbol (instead of the section)

for any relocation to a symbol defined in a tls section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120121 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-11-24 21:57:39 +00:00
parent 8b4e60c276
commit 25958730df
3 changed files with 82 additions and 7 deletions

View File

@@ -718,10 +718,17 @@ const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
const MCSectionELF &Section =
static_cast<const MCSectionELF&>(ASymbol.getSection());
const SectionKind secKind = Section.getKind();
if (Section.getKind().isBSS())
if (secKind.isBSS())
return NULL;
if (secKind.isThreadLocal()) {
if (Renamed)
return Renamed;
return &Symbol;
}
MCSymbolRefExpr::VariantKind Kind = Target.getSymA()->getKind();
const MCSectionELF &Sec2 =
static_cast<const MCSectionELF&>(F.getParent()->getSection());
@@ -729,8 +736,7 @@ const MCSymbol *ELFObjectWriter::SymbolToReloc(const MCAssembler &Asm,
if (&Sec2 != &Section &&
(Kind == MCSymbolRefExpr::VK_PLT ||
Kind == MCSymbolRefExpr::VK_GOTPCREL ||
Kind == MCSymbolRefExpr::VK_GOTOFF ||
Kind == MCSymbolRefExpr::VK_NTPOFF)) {
Kind == MCSymbolRefExpr::VK_GOTOFF)) {
if (Renamed)
return Renamed;
return &Symbol;