diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp --- a/bolt/lib/Core/BinaryContext.cpp +++ b/bolt/lib/Core/BinaryContext.cpp @@ -155,12 +155,17 @@ Twine("BOLT-ERROR: no register info for target ", TripleName)); // Set up disassembler. - std::unique_ptr AsmInfo( + std::unique_ptr AsmInfo( TheTarget->createMCAsmInfo(*MRI, TripleName, MCTargetOptions())); if (!AsmInfo) return createStringError( make_error_code(std::errc::not_supported), Twine("BOLT-ERROR: no assembly info for target ", TripleName)); + // BOLT creates "func@PLT" symbols for PLT entries. In function assembly dump + // we want to emit such names as using @PLT without double quotes to convey + // variant kind to the assembler. BOLT doesn't rely on the linker so we can + // override the default AsmInfo behavior to emit names the way we want. + AsmInfo->setAllowAtInName(true); std::unique_ptr STI( TheTarget->createMCSubtargetInfo(TripleName, "", FeaturesStr)); diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h --- a/llvm/include/llvm/MC/MCAsmInfo.h +++ b/llvm/include/llvm/MC/MCAsmInfo.h @@ -671,6 +671,7 @@ const char *getCode64Directive() const { return Code64Directive; } unsigned getAssemblerDialect() const { return AssemblerDialect; } bool doesAllowAtInName() const { return AllowAtInName; } + void setAllowAtInName(bool V) { AllowAtInName = V; } bool doesAllowQuestionAtStartOfIdentifier() const { return AllowQuestionAtStartOfIdentifier; }