Add a bit along with the MCSymbols stored in the MachineModuleInfo maps that

indicates that an MCSymbol is external or not. (It's true if it's external.)
This will be used to specify the correct information to add to non-lazy
pointers. That will be explained further when this bit is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2010-03-10 22:34:10 +00:00
parent bfdf7f3852
commit cebae36f57
8 changed files with 140 additions and 98 deletions

View File

@@ -404,14 +404,19 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
// Add information about the stub reference to ELFMMI so that the stub
// gets emitted by the asmprinter.
MCSymbol *Sym = getContext().GetOrCreateTemporarySymbol(Name.str());
MCSymbol *&StubSym = ELFMMI.getGVStubEntry(Sym);
if (StubSym == 0) {
MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(Sym);
if (StubSym.getPointer() == 0) {
Name.clear();
Mang->getNameWithPrefix(Name, GV, false);
if (GV->hasPrivateLinkage())
StubSym = getContext().GetOrCreateTemporarySymbol(Name.str());
StubSym = MachineModuleInfoImpl::
StubValueTy(getContext().GetOrCreateTemporarySymbol(Name.str()),
false);
else
StubSym = getContext().GetOrCreateSymbol(Name.str());
StubSym = MachineModuleInfoImpl::
StubValueTy(getContext().GetOrCreateSymbol(Name.str()),
!GV->hasInternalLinkage());
}
return TargetLoweringObjectFile::
@@ -761,14 +766,19 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
// Add information about the stub reference to MachOMMI so that the stub
// gets emitted by the asmprinter.
MCSymbol *Sym = getContext().GetOrCreateTemporarySymbol(Name.str());
MCSymbol *&StubSym = MachOMMI.getGVStubEntry(Sym);
if (StubSym == 0) {
MachineModuleInfoImpl::StubValueTy &StubSym = MachOMMI.getGVStubEntry(Sym);
if (StubSym.getPointer() == 0) {
Name.clear();
Mang->getNameWithPrefix(Name, GV, false);
if (GV->hasPrivateLinkage())
StubSym = getContext().GetOrCreateTemporarySymbol(Name.str());
StubSym = MachineModuleInfoImpl::
StubValueTy(getContext().GetOrCreateTemporarySymbol(Name.str()),
false);
else
StubSym = getContext().GetOrCreateSymbol(Name.str());
StubSym = MachineModuleInfoImpl::
StubValueTy(getContext().GetOrCreateSymbol(Name.str()),
!GV->hasInternalLinkage());
}
return TargetLoweringObjectFile::