diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2024-06-02 12:17:03 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-06-04 09:50:32 +0000 |
| commit | 11f2afa5a3c8cc88e10b001d6eb8790c8a3b91a7 (patch) | |
| tree | aed911ddb145445af02d18db7c0e73699522c2ef /pkg/report | |
| parent | 06bf8101debe879447d0ef3a7a5b84cb11fa5acf (diff) | |
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.
Diffstat (limited to 'pkg/report')
| -rw-r--r-- | pkg/report/linux.go | 12 |
1 files changed, 3 insertions, 9 deletions
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) } |
