Allow hbd to be bugpointable on darwin by fixing common and linkonce codegen

llvm-svn: 17637
This commit is contained in:
Nate Begeman 2004-11-09 04:01:18 +00:00
parent 1df8148b01
commit 1164955bf1
2 changed files with 4 additions and 4 deletions

View File

@ -411,7 +411,6 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
#elif (defined(__POWERPC__) || defined(__ppc__)) && defined(__APPLE__)
"-single_module", // link all source files into a single module
"-dynamiclib", // `-dynamiclib' for MacOS X/PowerPC
"-fno-common", // allow global vars w/o initializers to live
"-undefined", // in data segment, rather than generating
"dynamic_lookup", // blocks. dynamic_lookup requires that you set
// MACOSX_DEPLOYMENT_TARGET=10.3 in your env.

View File

@ -367,8 +367,8 @@ void PowerPCAsmPrinter::printOp(const MachineOperand &MO,
}
// External or weakly linked global variables need non-lazily-resolved stubs
if ((GV->isExternal() || GV->hasWeakLinkage()) &&
getTM().AddressTaken.count(GV)) {
if ((GV->isExternal() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage())
&& getTM().AddressTaken.count(GV)) {
GVStubs.insert(Name);
O << "L" << Name << "$non_lazy_ptr";
return;
@ -472,7 +472,8 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
unsigned Align = TD.getTypeAlignmentShift(C->getType());
if (C->isNullValue() && /* FIXME: Verify correct */
(I->hasInternalLinkage() || I->hasWeakLinkage())) {
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
I->hasLinkOnceLinkage())) {
SwitchSection(O, CurSection, ".data");
if (I->hasInternalLinkage())
O << ".lcomm " << name << "," << TD.getTypeSize(C->getType())