fix(goobj): make R_DWTXTADDR_U4 relocation type Go-version-aware

The relocation type number shifted between Go 1.26 (103) and Go 1.27
(106)
because new LoongArch relocations were inserted. Detect the Go version
at
runtime and use the correct value.
This commit is contained in:
2026-08-20 15:35:39 +02:00
parent 48334c4d5a
commit 5d66343488
5 changed files with 46 additions and 7 deletions
+1 -1
View File
@@ -186,7 +186,7 @@ DATA mask<>+8(SB)/8, $0x800f0e0d0c0b0a09
t.Errorf("addq lines reloc = %x", lr)
}
dr := relocs[23:46]
if dr[4] != 4 || le.Uint16(dr[5:]) != relocDWTXTADDRU4 ||
if dr[4] != 4 || le.Uint16(dr[5:]) != relocDWTXTADDRU4() ||
le.Uint32(dr[15:]) != pkgIdxNone || le.Uint32(dr[19:]) != 4 {
t.Errorf("addq DIE reloc = %x", dr)
}