diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-19 01:28:30 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-02-19 01:28:30 +0000 |
commit | faaa5532749f4445dd6a02ad3be13472aaeae235 (patch) | |
tree | 7d300dbe47cbbed6e51ea20d02e6042afbf7295d /lib/CodeGen/TargetLoweringBase.cpp | |
parent | 7a8ca279cde02a44bf8c77e20eac1bd5bdbf582b (diff) | |
download | llvm-faaa5532749f4445dd6a02ad3be13472aaeae235.tar.gz llvm-faaa5532749f4445dd6a02ad3be13472aaeae235.tar.bz2 llvm-faaa5532749f4445dd6a02ad3be13472aaeae235.tar.xz |
Avoid an infinite cycle with private linkage and -f{data|function}-sections.
When outputting an object we check its section to find its name, but when
looking for the section with -ffunction-section we look for the symbol name.
Break the loop by requesting a name with the private prefix when constructing
the section name. This matches the behavior before r201608.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | lib/CodeGen/TargetLoweringBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/TargetLoweringBase.cpp b/lib/CodeGen/TargetLoweringBase.cpp index a0ea3b3ba3..d3c42be5e6 100644 --- a/lib/CodeGen/TargetLoweringBase.cpp +++ b/lib/CodeGen/TargetLoweringBase.cpp @@ -1431,8 +1431,9 @@ bool TargetLoweringBase::isLegalAddressingMode(const AddrMode &AM, void TargetLoweringBase::getNameWithPrefix(SmallVectorImpl<char> &Name, const GlobalValue *GV, - Mangler &Mang) const { - if (!GV->hasPrivateLinkage()) { + Mangler &Mang, + bool MayAlwaysUsePrivate) const { + if (MayAlwaysUsePrivate || !GV->hasPrivateLinkage()) { // Simple case: If GV is not private, it is not important to find out if // private labels are legal in this case or not. Mang.getNameWithPrefix(Name, GV, false); |