From 11f2afa5a3c8cc88e10b001d6eb8790c8a3b91a7 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 2 Jun 2024 12:17:03 +0200 Subject: sys/targets: mark big-endian targets Litte-endian is kind of default (except for s390). So instead of saying that each arch is litte-endian, mark only s390 as big-endian. --- pkg/report/linux.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'pkg/report') diff --git a/pkg/report/linux.go b/pkg/report/linux.go index 50877e382..1dd5879cf 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -5,7 +5,6 @@ package report import ( "bytes" - "encoding/binary" "fmt" "path/filepath" "regexp" @@ -580,11 +579,6 @@ func (ctx *linux) decompileWithOffset(parsed parsedOpcodes) (*decompiledOpcodes, } func (ctx *linux) parseOpcodes(codeSlice string) (parsedOpcodes, error) { - binaryOps := binary.ByteOrder(binary.BigEndian) - if ctx.target.LittleEndian { - binaryOps = binary.LittleEndian - } - width := 0 bytes := []byte{} trapOffset := -1 @@ -620,11 +614,11 @@ func (ctx *linux) parseOpcodes(codeSlice string) (parsedOpcodes, error) { case 1: extraBytes[0] = byte(number) case 2: - binaryOps.PutUint16(extraBytes, uint16(number)) + ctx.target.HostEndian.PutUint16(extraBytes, uint16(number)) case 4: - binaryOps.PutUint32(extraBytes, uint32(number)) + ctx.target.HostEndian.PutUint32(extraBytes, uint32(number)) case 8: - binaryOps.PutUint64(extraBytes, number) + ctx.target.HostEndian.PutUint64(extraBytes, number) default: return parsedOpcodes{}, fmt.Errorf("invalid opcodes string: invalid width %v", width) } -- cgit mrf-deployment