@@ -66,6 +66,37 @@ void emitCATTR(raw_ostream &OS, StringRef Name, GOFF::ESDRmode Rmode,
6666 OS << " ,PART(" << PartName << " )" ;
6767 OS << ' \n ' ;
6868}
69+
70+ void emitXATTR (raw_ostream &OS, StringRef Name, GOFF::ESDLinkageType Linkage,
71+ GOFF::ESDExecutable Executable,
72+ GOFF::ESDBindingScope BindingScope) {
73+ OS << Name << " XATTR " ;
74+ OS << " LINKAGE(" << (Linkage == GOFF::ESD_LT_OS ? " OS" : " XPLINK" ) << " )," ;
75+ if (Executable != GOFF::ESD_EXE_Unspecified)
76+ OS << " REFERENCE(" << (Executable == GOFF::ESD_EXE_CODE ? " CODE" : " DATA" )
77+ << " )," ;
78+ if (BindingScope != GOFF::ESD_BSC_Unspecified) {
79+ OS << " SCOPE(" ;
80+ switch (BindingScope) {
81+ case GOFF::ESD_BSC_Section:
82+ OS << " SECTION" ;
83+ break ;
84+ case GOFF::ESD_BSC_Module:
85+ OS << " MODULE" ;
86+ break ;
87+ case GOFF::ESD_BSC_Library:
88+ OS << " LIBRARY" ;
89+ break ;
90+ case GOFF::ESD_BSC_ImportExport:
91+ OS << " EXPORT" ;
92+ break ;
93+ default :
94+ break ;
95+ }
96+ OS << ' )' ;
97+ }
98+ OS << ' \n ' ;
99+ }
69100} // namespace
70101
71102void MCSectionGOFF::printSwitchToSection (const MCAsmInfo &MAI, const Triple &T,
@@ -96,6 +127,8 @@ void MCSectionGOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
96127 PRAttributes.Alignment , ED->EDAttributes .LoadBehavior ,
97128 PRAttributes.Executable , PRAttributes.IsReadOnly ,
98129 PRAttributes.SortKey , Name);
130+ emitXATTR (OS, Name, PRAttributes.Linkage , PRAttributes.Executable ,
131+ PRAttributes.BindingScope );
99132 ED->Emitted = true ;
100133 Emitted = true ;
101134 } else
0 commit comments