diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-25 17:57:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-25 17:57:37 +0000 |
commit | 2de95105721664ac33564809d7fa7ebaf7dbd61a (patch) | |
tree | df36529b7683eab182936320cde2c39e4fedc59d | |
parent | 3d0b52caf1fefe5abd79d115bc6c938085711b9d (diff) | |
download | bcm5719-llvm-2de95105721664ac33564809d7fa7ebaf7dbd61a.tar.gz bcm5719-llvm-2de95105721664ac33564809d7fa7ebaf7dbd61a.zip |
add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.
llvm-svn: 77083
-rw-r--r-- | llvm/lib/Target/TargetAsmInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/global-sections.ll | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetAsmInfo.cpp b/llvm/lib/Target/TargetAsmInfo.cpp index 3edbe93e561..727c584e3a8 100644 --- a/llvm/lib/Target/TargetAsmInfo.cpp +++ b/llvm/lib/Target/TargetAsmInfo.cpp @@ -326,6 +326,11 @@ const Section *TargetAsmInfo::SectionForGlobal(const GlobalValue *GV) const { // FIXME: Use mangler interface (PR4584). std::string Name = Prefix+GV->getNameStr(); + + // Pick up the flags for the uniquing section. + // FIXME: HACK. + Flags |= getFlagsForNamedSection(Name.c_str()); + return getNamedSection(Name.c_str(), Flags); } } diff --git a/llvm/test/CodeGen/X86/global-sections.ll b/llvm/test/CodeGen/X86/global-sections.ll new file mode 100644 index 00000000000..0b4ed3b3604 --- /dev/null +++ b/llvm/test/CodeGen/X86/global-sections.ll @@ -0,0 +1,8 @@ +; RUN: llvm-as < %s | llc -mtriple=i386-unknown-linux-gnu | FileCheck %s -check-prefix=LINUX + +@G1 = common global i32 0 + +; LINUX: .type G1,@object +; LINUX: .section .gnu.linkonce.b.G1,"aw",@nobits +; LINUX: .comm G1,4,4 + |