- 论坛徽章:
- 0
|
各位高手,我在Ubuntu(64bit)下编译程序后放到Android系统板子上不能执行,出现段错误,不知道是怎么回事,求指导,操作过程如下:
/ixdba/Linuxdata/lmm/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc -I /ixdba/Linuxdata/lmm/myandroid/bionic/libc/include -I /ixdba/Linuxdata/lmm/myandroid/bionic/libc/arch-arm/include -I /ixdba/Linuxdata/lmm/myandroid/bionic/libc/kernel/arch-arm/ -I /ixdba/Linuxdata/lmm/myandroid/bionic/libc/kernel/common/ -I /ixdba/Linuxdata/lmm/myandroid/bionic/libm/include/ -L /ixdba/Linuxdata/lmm/myandroid/out/target/product/sabresd_6dq/system/lib -Wl,-rpath-link /ixdba/Linuxdata/lmm/myandroid/out/target/product/sabresd_6dq/system/lib -std=c99 -fno-short-enums -mthumb -lm -nostdlib /ixdba/Linuxdata/lmm/myandroid/out/target/product/sabresd_6dq/obj/lib/crtbegin_dynamic.o /ixdba/Linuxdata/lmm/myandroid/out/target/product/sabresd_6dq/obj/lib/crtend_android.o -Wl,-dynamic-linker,/system/bin/linker -o hello hello.c
编译器是手册给的
/ixdba/Linuxdata/lmm/myandroid/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-objdump -d hello
hello: file format elf32-littlearm
Disassembly of section .plt:
000081b8 <.plt>:
81b8: e52de004 push {lr} ; (str lr, [sp, #-4]!)
81bc: e59fe004 ldr lr, [pc, #4] ; 81c8 <_start-0x28>
81c0: e08fe00e add lr, pc, lr
81c4: e5bef008 ldr pc, [lr, #8]!
81c8: 00008208 .word 0x00008208
81cc: e28fc600 add ip, pc, #0
81d0: e28cca08 add ip, ip, #32768 ; 0x8000
81d4: e5bcf208 ldr pc, [ip, #520]! ; 0x208
81d8: e28fc600 add ip, pc, #0
81dc: e28cca08 add ip, ip, #32768 ; 0x8000
81e0: e5bcf200 ldr pc, [ip, #512]! ; 0x200
81e4: e28fc600 add ip, pc, #0
81e8: e28cca08 add ip, ip, #32768 ; 0x8000
81ec: e5bcf1f8 ldr pc, [ip, #504]! ; 0x1f8
Disassembly of section .text:
000081f0 <_start>:
81f0: e92d4800 push {fp, lr}
81f4: e28db004 add fp, sp, #4
81f8: e24dd010 sub sp, sp, #16
81fc: e59f3050 ldr r3, [pc, #80] ; 8254 <_start+0x64>
8200: e08f3003 add r3, pc, r3
8204: e59f204c ldr r2, [pc, #76] ; 8258 <_start+0x68>
8208: e7932002 ldr r2, [r3, r2]
820c: e50b2014 str r2, [fp, #-20]
8210: e59f2044 ldr r2, [pc, #68] ; 825c <_start+0x6c>
8214: e7932002 ldr r2, [r3, r2]
8218: e50b2010 str r2, [fp, #-16]
821c: e59f203c ldr r2, [pc, #60] ; 8260 <_start+0x70>
8220: e7932002 ldr r2, [r3, r2]
8224: e50b200c str r2, [fp, #-12]
8228: e1a0200b mov r2, fp
822c: e2822004 add r2, r2, #4
8230: e50b2008 str r2, [fp, #-8]
8234: e24bc014 sub ip, fp, #20
8238: e51b0008 ldr r0, [fp, #-8]
823c: e3a01000 mov r1, #0
8240: e59f201c ldr r2, [pc, #28] ; 8264 <_start+0x74>
8244: e7933002 ldr r3, [r3, r2]
8248: e1a02003 mov r2, r3
824c: e1a0300c mov r3, ip
8250: ebffffe0 bl 81d8 <_start-0x18>
8254: 000081c8 .word 0x000081c8
8258: 00000024 .word 0x00000024
825c: 0000001c .word 0x0000001c
8260: 00000018 .word 0x00000018
8264: 00000020 .word 0x00000020
00008268 <atexit>:
8268: e92d4800 push {fp, lr}
826c: e28db004 add fp, sp, #4
8270: e24dd008 sub sp, sp, #8
8274: e50b0008 str r0, [fp, #-8]
8278: e51b0008 ldr r0, [fp, #-8]
827c: e3a01000 mov r1, #0
8280: e59f3018 ldr r3, [pc, #24] ; 82a0 <atexit+0x38>
8284: e08f3003 add r3, pc, r3
8288: e1a02003 mov r2, r3
828c: ebffffd4 bl 81e4 <_start-0xc>
8290: e1a03000 mov r3, r0
8294: e1a00003 mov r0, r3
8298: e24bd004 sub sp, fp, #4
829c: e8bd8800 pop {fp, pc}
82a0: 0000816c .word 0x0000816c
000082a4 <main>:
82a4: b580 push {r7, lr}
82a6: af00 add r7, sp, #0
82a8: 4b03 ldr r3, [pc, #12] ; (82b8 <main+0x14>)
82aa: 1c18 adds r0, r3, #0
82ac: f7ff ef8e blx 81cc <_start-0x24>
82b0: 2300 movs r3, #0
82b2: 1c18 adds r0, r3, #0
82b4: 46bd mov sp, r7
82b6: bd80 pop {r7, pc}
82b8: 000082bc .word 0x000082bc
望大神指点 |
|