Index: lib/MC/MCParser/COFFAsmParser.cpp =================================================================== --- lib/MC/MCParser/COFFAsmParser.cpp +++ lib/MC/MCParser/COFFAsmParser.cpp @@ -99,6 +99,8 @@ addDirectiveHandler<&COFFAsmParser::ParseSEHDirectiveEndProlog>( ".seh_endprologue"); addDirectiveHandler<&COFFAsmParser::ParseDirectiveSymbolAttribute>(".weak"); + addDirectiveHandler<&COFFAsmParser::ParseDirectiveSymbolAttribute>( + ".hidden"); } bool ParseSectionDirectiveText(StringRef, SMLoc) { @@ -285,10 +287,11 @@ } /// ParseDirectiveSymbolAttribute -/// ::= { ".weak", ... } [ identifier ( , identifier )* ] +/// ::= { ".weak", ".hidden", ... } [ identifier ( , identifier )* ] bool COFFAsmParser::ParseDirectiveSymbolAttribute(StringRef Directive, SMLoc) { MCSymbolAttr Attr = StringSwitch(Directive) .Case(".weak", MCSA_Weak) + .Case(".hidden", MCSA_Hidden) .Default(MCSA_Invalid); assert(Attr != MCSA_Invalid && "unexpected symbol attribute directive!"); if (getLexer().isNot(AsmToken::EndOfStatement)) { Index: test/MC/AArch64/coff-gas-directives.s =================================================================== --- /dev/null +++ test/MC/AArch64/coff-gas-directives.s @@ -0,0 +1,15 @@ +// RUN: llvm-mc -filetype=obj -triple aarch64-windows %s \ +// RUN: | llvm-readobj -t | FileCheck %s + + .hidden foo1 +foo1: + +// CHECK: Symbol { +// CHECK: Name: foo1 +// CHECK-NEXT: Value: 0 +// CHECK-NEXT: Section: .text (1) +// CHECK-NEXT: BaseType: Null (0x0) +// CHECK-NEXT: ComplexType: Null (0x0) +// CHECK-NEXT: StorageClass: Static (0x3) +// CHECK-NEXT: AuxSymbolCount: 0 +// CHECK-NEXT: }