mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Assume that we'll handle mangling the symbols earlier and just put the
symbol to the file as we have it. Simplifies out tbss handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103928 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -363,14 +363,13 @@ void MCAsmStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
|||||||
EmitEOL();
|
EmitEOL();
|
||||||
}
|
}
|
||||||
|
|
||||||
// .tbss sym$tlv$init, size, align
|
// .tbss sym, size, align
|
||||||
|
// This depends that the symbol has already been mangled from the original,
|
||||||
|
// e.g. _a.
|
||||||
void MCAsmStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
|
void MCAsmStreamer::EmitTBSSSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||||
unsigned ByteAlignment) {
|
unsigned ByteAlignment) {
|
||||||
assert(Symbol != NULL && "Symbol shouldn't be NULL!");
|
assert(Symbol != NULL && "Symbol shouldn't be NULL!");
|
||||||
OS << ".tbss ";
|
OS << ".tbss " << *Symbol << ", " << Size;
|
||||||
|
|
||||||
// This is a mach-o specific directive and the name requires some mangling.
|
|
||||||
OS << *Symbol << "$tlv$init, " << Size;
|
|
||||||
|
|
||||||
// Output align if we have it.
|
// Output align if we have it.
|
||||||
if (ByteAlignment != 0) OS << ", " << Log2_32(ByteAlignment);
|
if (ByteAlignment != 0) OS << ", " << Log2_32(ByteAlignment);
|
||||||
|
@ -1437,12 +1437,8 @@ bool AsmParser::ParseDirectiveDarwinTBSS() {
|
|||||||
if (ParseIdentifier(Name))
|
if (ParseIdentifier(Name))
|
||||||
return TokError("expected identifier in directive");
|
return TokError("expected identifier in directive");
|
||||||
|
|
||||||
// Demangle the name output. The trailing characters are guaranteed to be
|
|
||||||
// $tlv$init so just strip that off.
|
|
||||||
StringRef DemName = Name.substr(0, Name.size() - strlen("$tlv$init"));
|
|
||||||
|
|
||||||
// Handle the identifier as the key symbol.
|
// Handle the identifier as the key symbol.
|
||||||
MCSymbol *Sym = CreateSymbol(DemName);
|
MCSymbol *Sym = CreateSymbol(Name);
|
||||||
|
|
||||||
if (Lexer.isNot(AsmToken::Comma))
|
if (Lexer.isNot(AsmToken::Comma))
|
||||||
return TokError("unexpected token in directive");
|
return TokError("unexpected token in directive");
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
|
# RUN: llvm-mc -triple i386-unknown-darwin %s | FileCheck %s
|
||||||
|
|
||||||
# CHECK: .tbss _a$tlv$init, 4
|
# CHECK: .tbss _a$tlv$init, 4
|
||||||
# CHECK: .tbss _b$tlv$init, 4, 3
|
# CHECK: .tbss _b$tlv$init, 4, 3
|
||||||
|
Reference in New Issue
Block a user