add the most expedient hack to fix PR4619, along with a testcase.

Thanks to Rafael for the great example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77083 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-25 17:57:37 +00:00
parent 7e77f79591
commit 10cf6a6a4b
2 changed files with 13 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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