diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 20:01:42 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-07-09 20:01:42 +0000 |
commit | 9a06ed93594d7a1894d4e61c2925a98f661dd221 (patch) | |
tree | 9f402998605c2c824bf0877b5ef5ab4fb26b5b78 | |
parent | 88cef2480f1c3977c70eb549ecf83f5a2c99a7a8 (diff) | |
download | external_llvm-9a06ed93594d7a1894d4e61c2925a98f661dd221.zip external_llvm-9a06ed93594d7a1894d4e61c2925a98f661dd221.tar.gz external_llvm-9a06ed93594d7a1894d4e61c2925a98f661dd221.tar.bz2 |
Distinguish .const and .const_data on Darwin, when needed. This is somehow crazy :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53350 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index 965e8d6..e3bc507 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -245,6 +245,7 @@ const Section* X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { SectionKind::Kind Kind = SectionKindForGlobal(GV); bool isWeak = GV->isWeakForLinker(); + bool isNonStatic = (X86TM->getRelocationModel() != Reloc::Static); switch (Kind) { case SectionKind::Text: @@ -261,7 +262,8 @@ X86DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV) const { else return (isWeak ? DataCoalSection : getDataSection_()); case SectionKind::ROData: - return (isWeak ? ConstDataCoalSection : getReadOnlySection_()); + return (isWeak ? ConstDataCoalSection : + (isNonStatic ? ConstDataSection : getReadOnlySection_())); case SectionKind::RODataMergeStr: return (isWeak ? ConstDataCoalSection : |