Paste number 138202: faking linux ppc asm syntax

Index of paste annotations: 1

Paste number 138202: faking linux ppc asm syntax
Pasted by: fangism
When:11 years, 7 months ago
Share:Tweet this! | http://paste.lisp.org/+2YMY
Channel:None
Paste contents:
Raw Source | XML | Display As
~/local/src/LLVM-svn/gcc40-cmake-build/bin/llvm-mc -triple=powerpc-darwin8 -mcpu=g4 -relocation-model=pic -filetype=obj hello-puts-linux.s -o hello-puts-linux.o

.ll-machodump was created from hello-puts.ll-o, which was generated via llc -filetype=obj ...

diff -u hello-puts.ll-machodump hello-puts-linux.machodump
--- hello-puts.ll-machodump     2013-07-24 19:20:30.000000000 -0700
+++ hello-puts-linux.machodump  2013-07-25 13:28:02.000000000 -0700
@@ -10,9 +10,9 @@
   ('size', 396)
   ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
   ('vm_addr', 0)
-  ('vm_size', 130)
+  ('vm_size', 179)
   ('file_offset', 528)
-  ('file_size', 130)
+  ('file_size', 179)
   ('maxprot', 7)
   ('initprot', 7)
   ('num_sections', 5)
@@ -22,10 +22,10 @@
    (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
     ('address', 0)
-    ('size', 80)
+    ('size', 120)
     ('offset', 528)
     ('alignment', 4)
-    ('reloc_offset', 660)
+    ('reloc_offset', 708)
     ('num_reloc', 5)
     ('flags', 0x80000400)
     ('reserved1', 0)
@@ -33,27 +33,27 @@
    ),
   ('_relocations', [
     # Relocation 0
-    (('word-0', 0x34),
+    (('word-0', 0x44),
      ('word-1', 0x3c3)),
     # Relocation 1
     (('word-0', 0xab000030),
-     ('word-1', 0x74)),
+     ('word-1', 0xa4)),
     # Relocation 2
     (('word-0', 0xa1000000),
-     ('word-1', 0x14)),
+     ('word-1', 0x18)),
     # Relocation 3
-    (('word-0', 0xac00002c),
-     ('word-1', 0x74)),
+    (('word-0', 0xac000028),
+     ('word-1', 0xa4)),
     # Relocation 4
-    (('word-0', 0xa1000060),
-     ('word-1', 0x14)),
+    (('word-0', 0xa100008c),
+     ('word-1', 0x18)),
   ])
     # Section 1
    (('section_name', '__textcoal_nt\x00\x00\x00')
     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-    ('address', 80)
+    ('address', 120)
     ('size', 0)
-    ('offset', 608)
+    ('offset', 648)
     ('alignment', 0)
     ('reloc_offset', 0)
     ('num_reloc', 0)
@@ -66,11 +66,11 @@
     # Section 2
    (('section_name', '__picsymbolstub1')
     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-    ('address', 80)
+    ('address', 128)
     ('size', 32)
-    ('offset', 608)
+    ('offset', 656)
     ('alignment', 4)
-    ('reloc_offset', 700)
+    ('reloc_offset', 748)
     ('num_reloc', 4)
     ('flags', 0x80000408)
     ('reserved1', 0)
@@ -79,25 +79,25 @@
   ('_relocations', [
     # Relocation 0
     (('word-0', 0xab000014),
-     ('word-1', 0x70)),
+     ('word-1', 0xa0)),
     # Relocation 1
     (('word-0', 0xa1000000),
-     ('word-1', 0x58)),
+     ('word-1', 0x88)),
     # Relocation 2
     (('word-0', 0xac00000c),
-     ('word-1', 0x70)),
+     ('word-1', 0xa0)),
     # Relocation 3
     (('word-0', 0xa1000018),
-     ('word-1', 0x58)),
+     ('word-1', 0x88)),
   ])
     # Section 3
    (('section_name', '__la_symbol_ptr\x00')
     ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-    ('address', 112)
+    ('address', 160)
     ('size', 4)
-    ('offset', 640)
+    ('offset', 688)
     ('alignment', 0)
-    ('reloc_offset', 732)
+    ('reloc_offset', 780)
     ('num_reloc', 1)
     ('flags', 0x7)
     ('reserved1', 1)
@@ -111,9 +111,9 @@
     # Section 4
    (('section_name', '__cstring\x00\x00\x00\x00\x00\x00\x00')
     ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-    ('address', 116)
-    ('size', 14)
-    ('offset', 644)
+    ('address', 164)
+    ('size', 15)
+    ('offset', 692)
     ('alignment', 0)
     ('reloc_offset', 0)
     ('num_reloc', 0)
@@ -128,9 +128,9 @@
   # Load Command 1
  (('command', 2)
   ('size', 24)
-  ('symoff', 748)
+  ('symoff', 796)
   ('nsyms', 3)
-  ('stroff', 784)
+  ('stroff', 832)
   ('strsize', 40)
   ('_string_data', '\x00_main\x00dyld_stub_binding_helper\x00_puts\x00\x00\x00')
   ('_symbols', [
@@ -175,7 +175,7 @@
   ('nmodtab', 0)
   ('extrefsymoff', 0)
   ('nextrefsyms', 0)
-  ('indirectsymoff', 740)
+  ('indirectsymoff', 788)
   ('nindirectsyms', 2)
   ('extreloff', 0)
   ('nextrel', 0)

Annotations for this paste:

Annotation number 1: readobj diffs
Pasted by: fangism
When:11 years, 7 months ago
Share:Tweet this! | http://paste.lisp.org/+2YMY/1
Paste contents:
Raw Source | Display As
--- hello-puts.ll-readobj       2013-07-25 14:00:11.000000000 -0700
+++ hello-puts-linux.readobj    2013-07-25 14:00:11.000000000 -0700
@@ -1,23 +1,25 @@
 
-File: hello-puts.ll-o
+File: hello-puts-linux.o
 Format: Mach-O 32-bit ppc
 Arch: powerpc
 AddressSize: 32bit
 Relocations [
   Section __text {
-    0x34 1 2 0 PPC_RELOC_BR24 0 -
-    0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
-    0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
-    0x2C 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
-    0x60 0 2 n/a PPC_RELOC_PAIR 1 _main
+    0x44 1 2 0 PPC_RELOC_BR24 0 -
+    0x30 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
+    0x0 0 2 n/a PPC_RELOC_PAIR 1 .L0$pb
+    0x28 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
+    0x8C 0 2 n/a PPC_RELOC_PAIR 1 .L0$pb
+    0x14 1 2 0 PPC_RELOC_BR24 0 -
   }
   Section __picsymbolstub1 {
-    0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 _main
-    0x0 0 2 n/a PPC_RELOC_PAIR 1 _main
-    0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 _main
-    0x18 0 2 n/a PPC_RELOC_PAIR 1 _main
+    0x14 0 2 n/a PPC_RELOC_LO16_SECTDIFF 1 -
+    0x0 0 2 n/a PPC_RELOC_PAIR 1 -
+    0xC 0 2 n/a PPC_RELOC_HA16_SECTDIFF 1 -
+    0x18 0 2 n/a PPC_RELOC_PAIR 1 -
+    0x4 1 2 0 PPC_RELOC_BR14 0 -
   }
   Section __la_symbol_ptr {
     0x0 0 2 1 PPC_RELOC_VANILLA 0 dyld_stub_binding_helper
   }
 ]

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.