Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(435)

Delta Between Two Patch Sets: x86asm/objdumpext_test.go

Issue 95300044: code review 95300044: x86asm: basic 64-bit mode decoding (Closed)
Left Patch Set: diff -r 27604273fc7c https://code.google.com/p/rsc.x86/ Created 9 years, 10 months ago
Right Patch Set: diff -r 27604273fc7c https://code.google.com/p/rsc.x86/ Created 9 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « x86asm/objdump_test.go ('k') | x86asm/tables.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2014 The Go Authors. All rights reserved. 1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package x86asm 5 package x86asm
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "debug/elf" 9 "debug/elf"
10 "encoding/binary" 10 "encoding/binary"
(...skipping 23 matching lines...) Expand all
34 t.Fatal(err) 34 t.Fatal(err)
35 } 35 }
36 t.Skip(err) 36 t.Skip(err)
37 } 37 }
38 38
39 testExtDis(t, "gnu", arch, objdump, generate, allowedMismatchObjdump) 39 testExtDis(t, "gnu", arch, objdump, generate, allowedMismatchObjdump)
40 } 40 }
41 41
42 func objdump(ext *ExtDis) error { 42 func objdump(ext *ExtDis) error {
43 // File already written with instructions; add ELF header. 43 // File already written with instructions; add ELF header.
44 println("objdump", ext.Arch)
45 if ext.Arch == 32 { 44 if ext.Arch == 32 {
46 if err := writeELF32(ext.File, ext.Size); err != nil { 45 if err := writeELF32(ext.File, ext.Size); err != nil {
47 return err 46 return err
48 } 47 }
49 } else { 48 } else {
50 if err := writeELF64(ext.File, ext.Size); err != nil { 49 if err := writeELF64(ext.File, ext.Size); err != nil {
51 return err 50 return err
52 } 51 }
53 } 52 }
54 53
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 Addr: 0, 304 Addr: 0,
306 Off: uint64(off2 + (off3-off2)*3), 305 Off: uint64(off2 + (off3-off2)*3),
307 Size: uint64(len("\x00.text\x00.shstrtab\x00")), 306 Size: uint64(len("\x00.text\x00.shstrtab\x00")),
308 Addralign: 1, 307 Addralign: 1,
309 } 308 }
310 binary.Write(&buf, binary.LittleEndian, &sect) 309 binary.Write(&buf, binary.LittleEndian, &sect)
311 buf.WriteString("\x00.text\x00.shstrtab\x00") 310 buf.WriteString("\x00.text\x00.shstrtab\x00")
312 f.Write(buf.Bytes()) 311 f.Write(buf.Bytes())
313 return nil 312 return nil
314 } 313 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b