diff options
| author | Tim Northover <tnorthover@apple.com> | 2014-03-29 07:05:06 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2014-03-29 07:05:06 +0000 |
| commit | c3988b4aa3d2d9675fc75a221f5d1c3b64cfcd9b (patch) | |
| tree | 6019822b28a28dceb9a6b999a19af95930365ff5 /llvm/lib/MC/MCContext.cpp | |
| parent | 9086f061f0f97f2b2b5f9b943d5a01e54646aa92 (diff) | |
| download | bcm5719-llvm-c3988b4aa3d2d9675fc75a221f5d1c3b64cfcd9b.tar.gz bcm5719-llvm-c3988b4aa3d2d9675fc75a221f5d1c3b64cfcd9b.zip | |
MachO: allow each section to have a linker-private symbol
The upcoming ARM64 backend doesn't have section-relative relocations,
so we give each section its own symbol to provide this functionality.
Of course, it doesn't need to appear in the final executable, so
linker-private is the best kind for this purpose.
llvm-svn: 205081
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
| -rw-r--r-- | llvm/lib/MC/MCContext.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index fdedec1031a..73ffdc0a4bd 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -153,6 +153,13 @@ MCSymbol *MCContext::GetOrCreateSymbol(const Twine &Name) { return GetOrCreateSymbol(Name.toStringRef(NameSV)); } +MCSymbol *MCContext::CreateLinkerPrivateTempSymbol() { + SmallString<128> NameSV; + raw_svector_ostream(NameSV) + << MAI->getLinkerPrivateGlobalPrefix() << "tmp" << NextUniqueID++; + return CreateSymbol(NameSV); +} + MCSymbol *MCContext::CreateTempSymbol() { SmallString<128> NameSV; raw_svector_ostream(NameSV) |

