diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-21 23:47:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-21 23:47:11 +0000 |
commit | 97d2cae44bb012b51d7781fd24fdbb4e73553b61 (patch) | |
tree | c34a63dff5cc71f365d81f4bb6455fc5efe7b2ae /lib/Target/ELFTargetAsmInfo.cpp | |
parent | 248f80d4880ef949686ecbd76b5f5b7c2a88d8db (diff) |
Now that RelocBehaviour() is never overloaded, it doesn't need to be
virtual. Just inline it into its two current call sites in preparation
for simplifying the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ELFTargetAsmInfo.cpp')
-rw-r--r-- | lib/Target/ELFTargetAsmInfo.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/ELFTargetAsmInfo.cpp b/lib/Target/ELFTargetAsmInfo.cpp index bd2dd0a064..8ace00abd9 100644 --- a/lib/Target/ELFTargetAsmInfo.cpp +++ b/lib/Target/ELFTargetAsmInfo.cpp @@ -57,7 +57,13 @@ ELFTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const { if (GVar->hasInitializer()) { Constant *C = GVar->getInitializer(); bool isConstant = GVar->isConstant(); - unsigned Reloc = RelocBehaviour(); + + + // By default - all relocations in PIC mode would force symbol to be + // placed in r/w section. + unsigned Reloc = (TM.getRelocationModel() != Reloc::Static ? + Reloc::LocalOrGlobal : Reloc::None); + if (Reloc != Reloc::None && C->ContainsRelocations(Reloc)) return (C->ContainsRelocations(Reloc::Global) ? (isConstant ? |