bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/13321] New: Gold creates mixed Thumb/ARM files that objdump -d


From: mh-sourceware at glandium dot org
Subject: [Bug gold/13321] New: Gold creates mixed Thumb/ARM files that objdump -d doesn't understand
Date: Wed, 19 Oct 2011 16:27:38 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13321

             Bug #: 13321
           Summary: Gold creates mixed Thumb/ARM files that objdump -d
                    doesn't understand
           Product: binutils
           Version: 2.23 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: address@hidden
        ReportedBy: address@hidden
                CC: address@hidden
    Classification: Unclassified


I haven't looked exactly why this happens but here is the problem:

$ cat <<EOF >test.c
#include <stdio.h>
void foo() {
  printf("foo\n");
}
EOF
$ gcc -o test.so -shared test.c -mthumb -fPIC -Os -march=armv7-a
$ objdump -d test.so
test.so:     file format elf32-littlearm


Disassembly of section .plt:

000001d0 <.plt>:
 1d0:    e52de004     .word    0xe52de004
 1d4:    e59fe004     .word    0xe59fe004
 1d8:    e08fe00e     .word    0xe08fe00e
 1dc:    e5bef008     .word    0xe5bef008
 1e0:    000010c8     .word    0x000010c8
 1e4:    e28fc600     .word    0xe28fc600
 1e8:    e28cca01     .word    0xe28cca01
 1ec:    e5bcf0c8     .word    0xe5bcf0c8

Disassembly of section .text:

000001f0 <foo>:
 1f0:    4801          ldr    r0, [pc, #4]    ; (1f8 <foo+0x8>)
 1f2:    4478          add    r0, pc
 1f4:    f000 b802     b.w    1fc <foo+0xc>
 1f8:    00000016     .word    0x00000016
 1fc:    46c04778     .word    0x46c04778
 200:    e59fc000     .word    0xe59fc000
 204:    e08cf00f     .word    0xe08cf00f
 208:    ffffffd8     .word    0xffffffd8

With GNU ld:
$ gcc -o test.so -shared test.c -mthumb -fPIC -Os -march=armv7-a
$ objdump -d test.so
test.so:     file format elf32-littlearm


Disassembly of section .plt:

00000260 <.plt>:
 260:    e52de004     push    {lr}        ; (str lr, [sp, #-4]!)
 264:    e59fe004     ldr    lr, [pc, #4]    ; 270 <foo-0x14>
 268:    e08fe00e     add    lr, pc, lr
 26c:    e5bef008     ldr    pc, [lr, #8]!
 270:    000080b4     .word    0x000080b4
 274:    4778          bx    pc
 276:    46c0          nop            ; (mov r8, r8)
 278:    e28fc600     add    ip, pc, #0
 27c:    e28cca08     add    ip, ip, #32768    ; 0x8000
 280:    e5bcf0b0     ldr    pc, [ip, #176]!    ; 0xb0

Disassembly of section .text:

00000284 <foo>:
 284:    4801          ldr    r0, [pc, #4]    ; (28c <foo+0x8>)
 286:    4478          add    r0, pc
 288:    f7ff bff4     b.w    274 <foo-0x10>
 28c:    00000006     .word    0x00000006

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]