@@ -51,6 +51,7 @@ type ctxt7 struct {
51
51
blitrl * obj.Prog
52
52
elitrl * obj.Prog
53
53
autosize int32
54
+ extrasize int32
54
55
instoffset int64
55
56
pc int64
56
57
pool struct {
@@ -1121,7 +1122,8 @@ func span7(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
1121
1122
ctxt .Diag ("arm64 ops not initialized, call arm64.buildop first" )
1122
1123
}
1123
1124
1124
- c := ctxt7 {ctxt : ctxt , newprog : newprog , cursym : cursym , autosize : int32 (p .To .Offset )}
1125
+ c := ctxt7 {ctxt : ctxt , newprog : newprog , cursym : cursym , autosize : int32 (p .To .Offset & 0xffffffff ), extrasize : int32 (p .To .Offset >> 32 )}
1126
+ p .To .Offset &= 0xffffffff // extrasize is no longer needed
1125
1127
1126
1128
// Process literal pool and allocate initial program counter for each Prog, before
1127
1129
// generating branch veneers.
@@ -2117,8 +2119,8 @@ func (c *ctxt7) aclass(a *obj.Addr) int {
2117
2119
// a.Offset is still relative to pseudo-SP.
2118
2120
a .Reg = obj .REG_NONE
2119
2121
}
2120
- // The frame top 16 bytes are for LR/ FP
2121
- c .instoffset = int64 (c .autosize ) + a .Offset - extrasize
2122
+ // The frame top 8 or 16 bytes are for FP
2123
+ c .instoffset = int64 (c .autosize ) + a .Offset - int64 ( c . extrasize )
2122
2124
return autoclass (c .instoffset )
2123
2125
2124
2126
case obj .NAME_PARAM :
@@ -2178,8 +2180,8 @@ func (c *ctxt7) aclass(a *obj.Addr) int {
2178
2180
// a.Offset is still relative to pseudo-SP.
2179
2181
a .Reg = obj .REG_NONE
2180
2182
}
2181
- // The frame top 16 bytes are for LR/ FP
2182
- c .instoffset = int64 (c .autosize ) + a .Offset - extrasize
2183
+ // The frame top 8 or 16 bytes are for FP
2184
+ c .instoffset = int64 (c .autosize ) + a .Offset - int64 ( c . extrasize )
2183
2185
2184
2186
case obj .NAME_PARAM :
2185
2187
if a .Reg == REGSP {
0 commit comments