[llvm] r201365 - Use __literal16. It has been supported by the linker since 2005.
Rafael Espindola
rafael.espindola at gmail.com
Thu Feb 13 15:16:11 PST 2014
Author: rafael
Date: Thu Feb 13 17:16:11 2014
New Revision: 201365
URL: http://llvm.org/viewvc/llvm-project?rev=201365&view=rev
Log:
Use __literal16. It has been supported by the linker since 2005.
Modified:
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/trunk/lib/MC/MCObjectFileInfo.cpp
llvm/trunk/test/CodeGen/X86/global-sections.ll
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=201365&r1=201364&r2=201365&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Thu Feb 13 17:16:11 2014
@@ -562,7 +562,7 @@ SelectSectionForGlobal(const GlobalValue
return FourByteConstantSection;
if (Kind.isMergeableConst8())
return EightByteConstantSection;
- if (Kind.isMergeableConst16() && SixteenByteConstantSection)
+ if (Kind.isMergeableConst16())
return SixteenByteConstantSection;
}
@@ -601,7 +601,7 @@ TargetLoweringObjectFileMachO::getSectio
return FourByteConstantSection;
if (Kind.isMergeableConst8())
return EightByteConstantSection;
- if (Kind.isMergeableConst16() && SixteenByteConstantSection)
+ if (Kind.isMergeableConst16())
return SixteenByteConstantSection;
return ReadOnlySection; // .const
}
Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObjectFileInfo.cpp?rev=201365&r1=201364&r2=201365&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
+++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Thu Feb 13 17:16:11 2014
@@ -79,16 +79,10 @@ void MCObjectFileInfo::InitMachOMCObject
MCSectionMachO::S_8BYTE_LITERALS,
SectionKind::getMergeableConst8());
- // ld_classic doesn't support .literal16 in 32-bit mode, and ld64 falls back
- // to using it in -static mode.
- SixteenByteConstantSection = 0;
- if (RelocM != Reloc::Static &&
- T.getArch() != Triple::x86_64 && T.getArch() != Triple::ppc64 &&
- T.getArch() != Triple::ppc64le)
- SixteenByteConstantSection = // .literal16
- Ctx->getMachOSection("__TEXT", "__literal16",
- MCSectionMachO::S_16BYTE_LITERALS,
- SectionKind::getMergeableConst16());
+ SixteenByteConstantSection // .literal16
+ = Ctx->getMachOSection("__TEXT", "__literal16",
+ MCSectionMachO::S_16BYTE_LITERALS,
+ SectionKind::getMergeableConst16());
ReadOnlySection // .const
= Ctx->getMachOSection("__TEXT", "__const", 0,
Modified: llvm/trunk/test/CodeGen/X86/global-sections.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/global-sections.ll?rev=201365&r1=201364&r2=201365&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/global-sections.ll (original)
+++ llvm/trunk/test/CodeGen/X86/global-sections.ll Thu Feb 13 17:16:11 2014
@@ -1,5 +1,7 @@
; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX
; RUN: llc < %s -mtriple=i386-apple-darwin9.7 | FileCheck %s -check-prefix=DARWIN
+; RUN: llc < %s -mtriple=i386-apple-darwin10 -relocation-model=static | FileCheck %s -check-prefix=DARWIN-STATIC
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s -check-prefix=DARWIN64
; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -fdata-sections | FileCheck %s -check-prefix=LINUX-SECTIONS
@@ -47,6 +49,14 @@
; DARWIN: _G4:
; DARWIN: .long 34
+; DARWIN-STATIC: .section __TEXT,__literal16,16byte_literals
+; DARWIN-STATIC: _G4:
+; DARWIN-STATIC: .long 34
+
+; DARWIN64: .section __TEXT,__literal16,16byte_literals
+; DARWIN64: _G4:
+; DARWIN64: .quad 34
+
; int G5 = 47;
@G5 = global i32 47
More information about the llvm-commits
mailing list