[yocto] Unable to get serial console login prompt - PowerPC 440 Virtex 5 processor
Elvis Dowson
elvis.dowson at gmail.com
Sat Aug 4 06:56:57 PDT 2012
Hi,
On Aug 4, 2012, at 6:24 AM, Khem Raj wrote:
> OK couple of things. You could boot into static bash thats good, keep it that way and bundle some dynamically linked programs into the root file system
> may be just a hello world which is dynamically linked. I would also compile a static version of gdb and strace but that could be next steps.
>
> then boot into this static shell and try to run the dynamically linked hello world. Does that work ?
> if not we have a dynamic linking issue.
>
> Then you can go a step deeper and see whats going on. Many a times interpreter is specified wrongly in the elf file.
> and there could be dynamic linker issues too. But step at a time.
I created a new 16GB ramdisk file, and put the core-image-minimal root filesystem into it. I then created a static version and a dynamic version of the helloworld program.
I find that the static version of the helloworld loads okay, but the dynamic version of the helloworld program doesn't give any output.
I guess this means we have a dynamic linking issue.
I've attached the outputs of the readelf -h and -S commands, and the outputs of the objdump commands for the text and data sections for the helloworlddynamic program.
zImage starting: loaded at 0x00800000 (sp: 0x00f37fb0)
Allocating 0x540e0c bytes for kernel ...
gunzipping (0x00000000 <- 0x0080f000:0x00a17de4)...done 0x4235c0 bytes
Attached initrd image at 0x00a18000-0x00f36f10
initrd head: 0x1f8b0808
Linux/PowerPC load: console=ttyS0,9600n8 ip=off root=/dev/ram rw rootwait init=/helloworlddynamic
Finalizing device tree... flat tree at 0xf440e0
PM: Adding info for No Bus:ttyv9
[ 0.492863] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 0.498167] 83e00000.serial: ttyS0 at MMIO 0x83e01003 (irq = 20) is a 16550
[ 0.693672] console [ttyS0] enabled
[ 0.757577] brd: module loaded
[ 0.804366] loop: module loaded
[ 0.841663] xsysace 83600000.sysace: Xilinx SystemACE revision 1.0.12
[ 0.918399] xsysace 83600000.sysace: No CF in slot
[ 0.977368] Xilinx SystemACE device driver, major=254
[ 1.038331] xilinx_emaclite 81000000.ethernet: Device Tree Probing
[ 1.111862] xilinx_emaclite 81000000.ethernet: error registering MDIO bus
[ 1.192936] xilinx_emaclite 81000000.ethernet: MAC address is now 00:0a:35:b7:78:00
[ 1.286646] xilinx_emaclite 81000000.ethernet: Xilinx EmacLite at 0x81000000 mapped to 0xD10A0000, irq=17
[ 1.401504] xilinx_ps2 81480000.ps2: Device Tree Probing 'ps2'
[ 1.470737] xilinx_ps2 81480000.ps2: Xilinx PS2 at 0x81480000 mapped to 0xd1036000, irq=22
[ 1.570108] xilinx_ps2 81481000.ps2: Device Tree Probing 'ps2'
[ 1.639794] xilinx_ps2 81481000.ps2: Xilinx PS2 at 0x81481000 mapped to 0xd1038000, irq=23
[ 1.740312] mousedev: PS/2 mouse device common for all mice
[ 1.807658] i2c /dev entries driver
[ 1.849416] Device Tree Probing 'i2c'
[ 1.893623] xilinx-iic #0 at 0x81600000 mapped to 0xD10C0000, irq=18
[ 1.971280] TCP cubic registered
[ 2.009127] NET: Registered protocol family 17
[ 2.806385] atkbd serio0: keyboard reset failed on xilinxps2/serio at 81480000
[ 3.290656] RAMDISK: gzip image found at block 0
[ 3.818580] input: AT Raw Set 2 keyboard as /devices/plb.0/xps-ps2.1/81481000.ps2/serio1/input/input0
[ 4.750816] VFS: Mounted root (ext2 filesystem) on device 1:0.
[ 4.820805] Freeing unused kernel memory: 152k freed
Here is the output of the readelf -h and -S commands:
${CROSS_COMPILE}readelf -h helloworlddynamic
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC
Version: 0x1
Entry point address: 0x1000032c
Start of program headers: 52 (bytes into file)
Start of section headers: 4216 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 8
Size of section headers: 40 (bytes)
Number of section headers: 36
Section header string table index: 33
${CROSS_COMPILE}readelf -S helloworlddynamic
There are 36 section headers, starting at offset 0x1078:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 10000134 000134 00000d 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 10000144 000144 000020 00 A 0 0 4
[ 3] .gnu.hash GNU_HASH 10000164 000164 000020 04 A 4 0 4
[ 4] .dynsym DYNSYM 10000184 000184 000070 10 A 5 1 4
[ 5] .dynstr STRTAB 100001f4 0001f4 000064 00 A 0 0 1
[ 6] .gnu.version VERSYM 10000258 000258 00000e 02 A 4 0 2
[ 7] .gnu.version_r VERNEED 10000268 000268 000030 00 A 5 1 4
[ 8] .rela.dyn RELA 10000298 000298 00000c 0c A 4 0 4
[ 9] .rela.plt RELA 100002a4 0002a4 00003c 0c A 4 23 4
[10] .init PROGBITS 100002e0 0002e0 00004c 00 AX 0 0 4
[11] .text PROGBITS 1000032c 00032c 000348 00 AX 0 0 4
[12] .fini PROGBITS 10000674 000674 000030 00 AX 0 0 4
[13] .rodata PROGBITS 100006a4 0006a4 000039 00 A 0 0 4
[14] .eh_frame_hdr PROGBITS 100006e0 0006e0 000014 00 A 0 0 4
[15] .eh_frame PROGBITS 100006f4 0006f4 00002c 00 A 0 0 4
[16] .ctors PROGBITS 10010720 000720 000008 00 WA 0 0 4
[17] .dtors PROGBITS 10010728 000728 000008 00 WA 0 0 4
[18] .jcr PROGBITS 10010730 000730 000004 00 WA 0 0 4
[19] .got2 PROGBITS 10010734 000734 000008 00 WA 0 0 1
[20] .dynamic DYNAMIC 1001073c 00073c 0000c8 08 WA 5 0 4
[21] .data PROGBITS 10010804 000804 000008 00 WA 0 0 4
[22] .got PROGBITS 1001080c 00080c 000014 04 WAX 0 0 4
[23] .plt NOBITS 10010820 000820 000084 00 WAX 0 0 4
[24] .bss NOBITS 100108a4 000820 000008 00 WA 0 0 4
[25] .comment PROGBITS 00000000 000820 000027 01 MS 0 0 1
[26] .debug_aranges PROGBITS 00000000 000847 000038 00 0 0 1
[27] .debug_info PROGBITS 00000000 00087f 0001d6 00 0 0 1
[28] .debug_abbrev PROGBITS 00000000 000a55 00014d 00 0 0 1
[29] .debug_line PROGBITS 00000000 000ba2 000113 00 0 0 1
[30] .debug_frame PROGBITS 00000000 000cb8 00005c 00 0 0 4
[31] .debug_str PROGBITS 00000000 000d14 000154 01 MS 0 0 1
[32] .debug_loc PROGBITS 00000000 000e68 0000cf 00 0 0 1
[33] .shstrtab STRTAB 00000000 000f37 000140 00 0 0 1
[34] .symtab SYMTAB 00000000 001618 000520 10 35 58 4
[35] .strtab STRTAB 00000000 001b38 0002d6 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Here is the output of the objdump command:
${CROSS_COMPILE}objdump -d -j .text helloworlddynamic
helloworlddynamic: file format elf32-powerpc
Disassembly of section .text:
1000032c <_start>:
1000032c: 7c 29 0b 78 mr r9,r1
10000330: 54 21 00 36 rlwinm r1,r1,0,0,27
10000334: 38 00 00 00 li r0,0
10000338: 94 21 ff f0 stwu r1,-16(r1)
1000033c: 7c 08 03 a6 mtlr r0
10000340: 90 01 00 00 stw r0,0(r1)
10000344: 3d 00 10 00 lis r8,4096
10000348: 85 a8 06 a4 lwzu r13,1700(r8)
1000034c: 48 01 05 34 b 10010880 <__libc_start_main at plt>
10000350 <deregister_tm_clones>:
10000350: 3d 20 10 01 lis r9,4097
10000354: 3c 60 10 01 lis r3,4097
10000358: 39 29 08 0c addi r9,r9,2060
1000035c: 38 63 08 0c addi r3,r3,2060
10000360: 39 29 00 03 addi r9,r9,3
10000364: 7d 23 48 50 subf r9,r3,r9
10000368: 2b 89 00 06 cmplwi cr7,r9,6
1000036c: 4c bd 00 20 blelr+ cr7
10000370: 3d 20 00 00 lis r9,0
10000374: 39 29 00 00 addi r9,r9,0
10000378: 2f 89 00 00 cmpwi cr7,r9,0
1000037c: 4d 9e 00 20 beqlr cr7
10000380: 7d 29 03 a6 mtctr r9
10000384: 4e 80 04 20 bctr
10000388 <register_tm_clones>:
10000388: 3c 60 10 01 lis r3,4097
1000038c: 3d 20 10 01 lis r9,4097
10000390: 38 63 08 0c addi r3,r3,2060
10000394: 39 29 08 0c addi r9,r9,2060
10000398: 7d 23 48 50 subf r9,r3,r9
1000039c: 7d 29 16 70 srawi r9,r9,2
100003a0: 7d 24 0e 70 srawi r4,r9,1
100003a4: 7c 84 01 95 addze. r4,r4
100003a8: 4d a2 00 20 beqlr+
100003ac: 3d 20 00 00 lis r9,0
100003b0: 39 29 00 00 addi r9,r9,0
100003b4: 2f 89 00 00 cmpwi cr7,r9,0
100003b8: 4d 9e 00 20 beqlr cr7
100003bc: 7d 29 03 a6 mtctr r9
100003c0: 4e 80 04 20 bctr
100003c4 <__do_global_dtors_aux>:
100003c4: 94 21 ff e0 stwu r1,-32(r1)
100003c8: 7c 08 02 a6 mflr r0
100003cc: 93 81 00 10 stw r28,16(r1)
100003d0: 3f 80 10 01 lis r28,4097
100003d4: 89 3c 08 a4 lbz r9,2212(r28)
100003d8: 90 01 00 24 stw r0,36(r1)
100003dc: 93 a1 00 14 stw r29,20(r1)
100003e0: 2f 89 00 00 cmpwi cr7,r9,0
100003e4: 93 c1 00 18 stw r30,24(r1)
100003e8: 93 e1 00 1c stw r31,28(r1)
100003ec: 40 9e 00 64 bne- cr7,10000450 <__do_global_dtors_aux+0x8c>
100003f0: 3f a0 10 01 lis r29,4097
100003f4: 3f c0 10 01 lis r30,4097
100003f8: 3f e0 10 01 lis r31,4097
100003fc: 3b bd 07 28 addi r29,r29,1832
10000400: 3b de 07 2c addi r30,r30,1836
10000404: 81 3f 08 a8 lwz r9,2216(r31)
10000408: 7f dd f0 50 subf r30,r29,r30
1000040c: 3b ff 08 a8 addi r31,r31,2216
10000410: 7f de 16 70 srawi r30,r30,2
10000414: 3b de ff ff addi r30,r30,-1
10000418: 7f 89 f0 40 cmplw cr7,r9,r30
1000041c: 40 9c 00 28 bge- cr7,10000444 <__do_global_dtors_aux+0x80>
10000420: 39 29 00 01 addi r9,r9,1
10000424: 55 2a 10 3a rlwinm r10,r9,2,0,29
10000428: 91 3f 00 00 stw r9,0(r31)
1000042c: 7d 3d 50 2e lwzx r9,r29,r10
10000430: 7d 29 03 a6 mtctr r9
10000434: 4e 80 04 21 bctrl
10000438: 81 3f 00 00 lwz r9,0(r31)
1000043c: 7f 89 f0 40 cmplw cr7,r9,r30
10000440: 41 9c ff e0 blt+ cr7,10000420 <__do_global_dtors_aux+0x5c>
10000444: 4b ff ff 0d bl 10000350 <deregister_tm_clones>
10000448: 39 20 00 01 li r9,1
1000044c: 99 3c 08 a4 stb r9,2212(r28)
10000450: 80 01 00 24 lwz r0,36(r1)
10000454: 83 81 00 10 lwz r28,16(r1)
10000458: 83 a1 00 14 lwz r29,20(r1)
1000045c: 7c 08 03 a6 mtlr r0
10000460: 83 c1 00 18 lwz r30,24(r1)
10000464: 83 e1 00 1c lwz r31,28(r1)
10000468: 38 21 00 20 addi r1,r1,32
1000046c: 4e 80 00 20 blr
10000470 <call___do_global_dtors_aux>:
10000470: 94 21 ff f0 stwu r1,-16(r1)
10000474: 7c 08 02 a6 mflr r0
10000478: 90 01 00 14 stw r0,20(r1)
1000047c: 80 01 00 14 lwz r0,20(r1)
10000480: 38 21 00 10 addi r1,r1,16
10000484: 7c 08 03 a6 mtlr r0
10000488: 4e 80 00 20 blr
1000048c <frame_dummy>:
1000048c: 3c 60 10 01 lis r3,4097
10000490: 81 23 07 30 lwz r9,1840(r3)
10000494: 38 63 07 30 addi r3,r3,1840
10000498: 2f 89 00 00 cmpwi cr7,r9,0
1000049c: 41 9e 00 38 beq- cr7,100004d4 <frame_dummy+0x48>
100004a0: 3d 20 00 00 lis r9,0
100004a4: 39 29 00 00 addi r9,r9,0
100004a8: 2f 89 00 00 cmpwi cr7,r9,0
100004ac: 41 9e 00 28 beq- cr7,100004d4 <frame_dummy+0x48>
100004b0: 94 21 ff f0 stwu r1,-16(r1)
100004b4: 7c 08 02 a6 mflr r0
100004b8: 7d 29 03 a6 mtctr r9
100004bc: 90 01 00 14 stw r0,20(r1)
100004c0: 4e 80 04 21 bctrl
100004c4: 80 01 00 14 lwz r0,20(r1)
100004c8: 38 21 00 10 addi r1,r1,16
100004cc: 7c 08 03 a6 mtlr r0
100004d0: 4b ff fe b8 b 10000388 <register_tm_clones>
100004d4: 4b ff fe b4 b 10000388 <register_tm_clones>
100004d8 <call_frame_dummy>:
100004d8: 94 21 ff f0 stwu r1,-16(r1)
100004dc: 7c 08 02 a6 mflr r0
100004e0: 90 01 00 14 stw r0,20(r1)
100004e4: 80 01 00 14 lwz r0,20(r1)
100004e8: 38 21 00 10 addi r1,r1,16
100004ec: 7c 08 03 a6 mtlr r0
100004f0: 4e 80 00 20 blr
100004f4 <main>:
100004f4: 94 21 ff f0 stwu r1,-16(r1)
100004f8: 7c 08 02 a6 mflr r0
100004fc: 90 01 00 14 stw r0,20(r1)
10000500: 93 e1 00 0c stw r31,12(r1)
10000504: 7c 3f 0b 78 mr r31,r1
10000508: 38 60 00 0a li r3,10
1000050c: 48 01 03 7d bl 10010888 <putchar at plt>
10000510: 3d 20 10 00 lis r9,4096
10000514: 38 69 06 b8 addi r3,r9,1720
10000518: 3d 20 10 00 lis r9,4096
1000051c: 38 89 06 d0 addi r4,r9,1744
10000520: 48 01 03 49 bl 10010868 <printf at plt>
10000524: 3d 20 3b 9a lis r9,15258
10000528: 61 23 c9 ff ori r3,r9,51711
1000052c: 48 01 03 45 bl 10010870 <sleep at plt>
10000530: 39 20 00 00 li r9,0
10000534: 7d 23 4b 78 mr r3,r9
10000538: 39 7f 00 10 addi r11,r31,16
1000053c: 80 0b 00 04 lwz r0,4(r11)
10000540: 7c 08 03 a6 mtlr r0
10000544: 83 eb ff fc lwz r31,-4(r11)
10000548: 7d 61 5b 78 mr r1,r11
1000054c: 4e 80 00 20 blr
10000550: 00 01 81 d4 .long 0x181d4
10000554 <__libc_csu_init>:
10000554: 94 21 ff d0 stwu r1,-48(r1)
10000558: 7c 08 02 a6 mflr r0
1000055c: 42 9f 00 05 bcl- 20,4*cr7+so,10000560 <__libc_csu_init+0xc>
10000560: 93 c1 00 28 stw r30,40(r1)
10000564: 7f c8 02 a6 mflr r30
10000568: 90 01 00 34 stw r0,52(r1)
1000056c: 80 1e ff f0 lwz r0,-16(r30)
10000570: 93 21 00 14 stw r25,20(r1)
10000574: 7c 79 1b 78 mr r25,r3
10000578: 93 41 00 18 stw r26,24(r1)
1000057c: 7c 9a 23 78 mr r26,r4
10000580: 7f c0 f2 14 add r30,r0,r30
10000584: 93 61 00 1c stw r27,28(r1)
10000588: 93 81 00 20 stw r28,32(r1)
1000058c: 7c bb 2b 78 mr r27,r5
10000590: 93 a1 00 24 stw r29,36(r1)
10000594: 93 e1 00 2c stw r31,44(r1)
10000598: 4b ff fd 49 bl 100002e0 <_init>
1000059c: 81 3e 80 04 lwz r9,-32764(r30)
100005a0: 3b e0 00 00 li r31,0
100005a4: 83 9e 80 00 lwz r28,-32768(r30)
100005a8: 3b a9 ff fc addi r29,r9,-4
100005ac: 7f 89 e0 50 subf r28,r9,r28
100005b0: 7f 9c 16 71 srawi. r28,r28,2
100005b4: 41 82 00 28 beq- 100005dc <__libc_csu_init+0x88>
100005b8: 85 3d 00 04 lwzu r9,4(r29)
100005bc: 7f 23 cb 78 mr r3,r25
100005c0: 7f 44 d3 78 mr r4,r26
100005c4: 7f 65 db 78 mr r5,r27
100005c8: 3b ff 00 01 addi r31,r31,1
100005cc: 7d 29 03 a6 mtctr r9
100005d0: 4e 80 04 21 bctrl
100005d4: 7f 9f e0 00 cmpw cr7,r31,r28
100005d8: 40 9e ff e0 bne+ cr7,100005b8 <__libc_csu_init+0x64>
100005dc: 80 01 00 34 lwz r0,52(r1)
100005e0: 83 21 00 14 lwz r25,20(r1)
100005e4: 83 41 00 18 lwz r26,24(r1)
100005e8: 7c 08 03 a6 mtlr r0
100005ec: 83 61 00 1c lwz r27,28(r1)
100005f0: 83 81 00 20 lwz r28,32(r1)
100005f4: 83 a1 00 24 lwz r29,36(r1)
100005f8: 83 c1 00 28 lwz r30,40(r1)
100005fc: 83 e1 00 2c lwz r31,44(r1)
10000600: 38 21 00 30 addi r1,r1,48
10000604: 4e 80 00 20 blr
10000608 <__libc_csu_fini>:
10000608: 4e 80 00 20 blr
1000060c <__do_global_ctors_aux>:
1000060c: 94 21 ff f0 stwu r1,-16(r1)
10000610: 7c 08 02 a6 mflr r0
10000614: 90 01 00 14 stw r0,20(r1)
10000618: 93 e1 00 0c stw r31,12(r1)
1000061c: 3f e0 10 01 lis r31,4097
10000620: 3b ff 07 24 addi r31,r31,1828
10000624: 85 3f ff fc lwzu r9,-4(r31)
10000628: 2f 89 ff ff cmpwi cr7,r9,-1
1000062c: 41 9e 00 18 beq- cr7,10000644 <__do_global_ctors_aux+0x38>
10000630: 7d 29 03 a6 mtctr r9
10000634: 4e 80 04 21 bctrl
10000638: 85 3f ff fc lwzu r9,-4(r31)
1000063c: 2f 89 ff ff cmpwi cr7,r9,-1
10000640: 40 9e ff f0 bne+ cr7,10000630 <__do_global_ctors_aux+0x24>
10000644: 80 01 00 14 lwz r0,20(r1)
10000648: 83 e1 00 0c lwz r31,12(r1)
1000064c: 38 21 00 10 addi r1,r1,16
10000650: 7c 08 03 a6 mtlr r0
10000654: 4e 80 00 20 blr
10000658 <call___do_global_ctors_aux>:
10000658: 94 21 ff f0 stwu r1,-16(r1)
1000065c: 7c 08 02 a6 mflr r0
10000660: 90 01 00 14 stw r0,20(r1)
10000664: 80 01 00 14 lwz r0,20(r1)
10000668: 38 21 00 10 addi r1,r1,16
1000066c: 7c 08 03 a6 mtlr r0
10000670: 4e 80 00 20 blr
${CROSS_COMPILE}objdump -d -j .data helloworlddynamic
helloworlddynamic: file format elf32-powerpc
Disassembly of section .data:
10010804 <__data_start>:
10010804: 00 00 00 00 .long 0x0
10010808 <__dso_handle>:
10010808: 00 00 00 00 ....
I'm not sure what to infer with all this data, what should I be looking at or checking, to try to find out what's going wrong with dynamic linked programs built with gcc-4.7.2 for PowerPC440 ?
Best regards,
Elvis Dowson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20120804/524c5d35/attachment.html>
More information about the yocto
mailing list