@@ -23,13 +23,21 @@ namespace llvm {
2323
2424class MCSymbolGOFF : public MCSymbol {
2525 // Associated data area of the section. Needs to be emitted first.
26- MCSectionGOFF *ADA;
26+ MCSectionGOFF *ADA = nullptr ;
27+
28+ // Owner of the symbol if symbol is an external reference. External references
29+ // need a section, too, but adding them to a section would make the symbol
30+ // defined.
31+ MCSectionGOFF *Owner = nullptr ;
2732
2833 GOFF::LDAttr LDAttributes;
34+ GOFF::ERAttr ERAttributes;
35+
36+ GOFF::ESDExecutable CodeData = GOFF::ESDExecutable::ESD_EXE_Unspecified;
2937
3038 enum SymbolFlags : uint16_t {
3139 SF_LD = 0x01 , // LD attributes are set.
32- // Leave place for EX attributes .
40+ SF_ER = 0x02 , // ER attributes are set .
3341 SF_Hidden = 0x04 , // Symbol is hidden, aka not exported.
3442 SF_Weak = 0x08 , // Symbol is weak.
3543 };
@@ -46,12 +54,25 @@ class MCSymbolGOFF : public MCSymbol {
4654 GOFF::LDAttr &getLDAttributes () { return LDAttributes; }
4755 bool hasLDAttributes () const { return getFlags () & SF_LD; }
4856
57+ void setERAttributes (GOFF::ERAttr Attr) {
58+ modifyFlags (SF_ER, SF_ER);
59+ ERAttributes = Attr;
60+ }
61+ const GOFF::ERAttr &getERAttributes () const { return ERAttributes; }
62+ GOFF::ERAttr &getERAttributes () { return ERAttributes; }
63+ bool hasERAttributes () const { return getFlags () & SF_ER; }
64+
4965 void setADA (MCSectionGOFF *AssociatedDataArea) {
5066 ADA = AssociatedDataArea;
5167 AssociatedDataArea->RequiresNonZeroLength = true ;
5268 }
5369 MCSectionGOFF *getADA () const { return ADA; }
5470
71+ void setOwner (MCSectionGOFF *Owner) {
72+ this ->Owner = Owner;
73+ }
74+ MCSectionGOFF *getOwner () const { return Owner; }
75+
5576 bool isExternal () const { return IsExternal; }
5677 void setExternal (bool Value) const { IsExternal = Value; }
5778
@@ -64,6 +85,9 @@ class MCSymbolGOFF : public MCSymbol {
6485 void setWeak (bool Value = true ) { modifyFlags (Value ? SF_Weak : 0 , SF_Weak); }
6586 bool isWeak () const { return getFlags () & SF_Weak; }
6687
88+ void setCodeData (GOFF::ESDExecutable Value) { CodeData = Value; }
89+ GOFF::ESDExecutable getCodeData () const { return CodeData; }
90+
6791 void initAttributes ();
6892};
6993} // end namespace llvm
0 commit comments