ast,build: allow setting data attributes
Previously GLOBL/DATA attributes are set to RODATA. This diff removes that default and allows them to be set through the DataAttributes context method. Updates #2
This commit is contained in:
@@ -107,6 +107,10 @@ func (c *Context) StaticGlobal(name string) operand.Mem {
|
||||
return c.global.Base()
|
||||
}
|
||||
|
||||
func (c *Context) DataAttributes(a avo.Attribute) {
|
||||
c.activeglobal().Attributes = a
|
||||
}
|
||||
|
||||
func (c *Context) AddDatum(offset int, v operand.Constant) {
|
||||
if err := c.activeglobal().AddDatum(avo.NewDatum(offset, v)); err != nil {
|
||||
c.AddError(err)
|
||||
|
||||
Reference in New Issue
Block a user