X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=tools%2Fgold%2Fgold-plugin.cpp;h=d5d58d0e5885884e9cdd9dc49cedb31c01887ed6;hp=ffee1ff3258b3ab21fe66e2f337c89ef741d6647;hb=61c4e41480ef81f4449acc8604efdcd1c26607b2;hpb=4f17a54bfaafb639cd74250917cad5974b04d69a diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index ffee1ff3258..d5d58d0e588 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -637,8 +637,14 @@ getModuleForFile(LLVMContext &Context, claimed_file &F, raw_fd_ostream *ApiFile, keepGlobalValue(*GV, KeptAliases); break; - case LDPR_PREEMPTED_REG: case LDPR_PREEMPTED_IR: + // Gold might have selected a linkonce_odr and preempted a weak_odr. + // In that case we have to make sure we don't end up internalizing it. + if (!GV->isDiscardableIfUnused()) + Maybe.erase(Sym.name); + + // fall-through + case LDPR_PREEMPTED_REG: Drop.insert(GV); break;