<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman">Andrew,</FONT></DIV>
<DIV><FONT face="Times New Roman">I believe I already modify my u-boot to detect
the processor.</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">If I statically link my program, I find that
the program can run</FONT></DIV>
<DIV><FONT face="Times New Roman">on my MPC8272 platform properly, so I think
maybe the problem</FONT></DIV>
<DIV><FONT face="Times New Roman">is caused by shared library. However, the same
file system (of course,</FONT></DIV>
<DIV><FONT face="Times New Roman">same shared library) can run on my MPC8245
platform.</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">With the observation, I think my kernel is not
handling shared library</FONT></DIV>
<DIV><FONT face="Times New Roman">properly. Is there any part of the kernel I
should check?</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">I added some code in do_page_fault() to dump
some information, shown</FONT></DIV>
<DIV><FONT face="Times New Roman">as below, when my </FONT><FONT
face="Times New Roman">program get problem.</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV>
<DIV><FONT face="Times New Roman">PID=34(console): Trap=300, NIP=0x0ffc6d90,
LR=0x0ffc6d20, VM: (start=0x30000000,</FONT></DIV>
<DIV><FONT face="Times New Roman">end=0x30017000, flags=0x00000875),
addr=0x2e313056<BR>Segmentation fault</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">Thank you</FONT></DIV></DIV>
<DIV><FONT face="Times New Roman">Dennis</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt 新細明體">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt 新細明體; font-color: black"><B>From:</B>
<A title=awilliam@nortel.com href="mailto:awilliam@nortel.com">Andrew
Williams</A> </DIV>
<DIV style="FONT: 10pt 新細明體"><B>To:</B> <A title=dennis@loop.com.tw
href="mailto:dennis@loop.com.tw">Nai-Hsien</A> ; <A
title=linuxppc-embedded@ozlabs.org
href="mailto:linuxppc-embedded@ozlabs.org">linuxppc-embedded@ozlabs.org</A>
</DIV>
<DIV style="FONT: 10pt 新細明體"><B>Sent:</B> Tuesday, June 07, 2005 10:17
PM</DIV>
<DIV style="FONT: 10pt 新細明體"><B>Subject:</B> RE: MPC8272 runs application with
segmentation fault</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=565480514-07062005>Take
a alook at the checkcpu() routine in /cpu/mpc8260/cpu.c .</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005>Validate that your CPU is correctly being identified,
and thus initialized. </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=565480514-07062005>We
had identical symptoms with </SPAN></FONT><FONT face=Arial color=#0000ff
size=2><SPAN class=565480514-07062005>the 8270. </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=565480514-07062005>We
added the following after the case for the PVR_8260_HIP7:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005> </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005> case
PVR_8280a_HIP7:<BR> case
PVR_8280_HIP7:<BR>
k =
7;<BR>
printf (CPU_ID_STR " (HiP%d Rev %02x, Mask ", k,
rev);<BR>
break;</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005>include/asm-ppc/processor.h</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005> #define
PVR_8280_HIP7 0x80822013 </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005> #define PVR_8280a_HIP7
0x80822014 </SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=565480514-07062005>A.</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B>
linuxppc-embedded-bounces@ozlabs.org
[mailto:linuxppc-embedded-bounces@ozlabs.org] <B>On Behalf Of
</B>Nai-Hsien<BR><B>Sent:</B> June 7, 2005 9:11 AM<BR><B>To:</B>
linuxppc-embedded@ozlabs.org<BR><B>Subject:</B> MPC8272 runs application
with segmentation fault<BR><BR></FONT></DIV>
<DIV><FONT face="Times New Roman">Dear experts,</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">I have two hardware boards, one uses
MPC8245 and the other one uses MPC8272.</FONT></DIV>
<DIV><FONT face="Times New Roman">Initially, I use the MPC8245 board to port
Linux 2.4.20 and write some applications.</FONT></DIV>
<DIV><FONT face="Times New Roman">I already do a lot of test on the MPC8245
board and all my application programs work</FONT></DIV>
<DIV><FONT face="Times New Roman">fine.</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">After this, I use the same kernel
configuration and same file system that are being used</FONT></DIV>
<DIV><FONT face="Times New Roman">by the MPC8245 board to port the whole
system to </FONT><FONT face="Times New Roman">my MPC8272.</FONT></DIV>
<DIV><FONT face="Times New Roman">Now, I can boot the kernel and run busybox
well. However, when</FONT></DIV>
<DIV><FONT face="Times New Roman">I run my application programs, I always
get segmentation fault. Following is a strace</FONT></DIV>
<DIV><FONT face="Times New Roman">dump. Could anybody give me some
idea?</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT face="Times New Roman">Thank you</FONT></DIV>
<DIV><FONT face="Times New Roman">Dennis</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT
face="Times New Roman">====================================================</FONT></DIV>
<DIV><FONT face="Times New Roman">execve("sbin/console", ["sbin/console"],
[/* 6 vars */]) = 0<BR>uname({sys="Linux", node="6200_linux", ...}) =
0<BR>brk(0)
= 0x10059134<BR>open("/etc/ld.so.preload", O_RDONLY) = -1
ENOENT (No such file or directory)<BR>open("/etc/ld.so.cache",
O_RDONLY) = -1 ENOENT (No such file or
directory)<BR>open("/lib/libncurses.so.5", O_RDONLY) = 3<BR>read(3,
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\001"..., 1024) =
1024<BR>fstat64(0x3,
0x7ffff098)
= 0<BR>mmap(0xff97000, 362628, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xff97000<BR>mprotect(0xffd4000, 112772, PROT_NONE) =
0<BR>mmap(0xffd7000, 86016, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x30000) = 0xffd7000<BR>mmap(0xffec000, 14468,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0)
=
0xffec000<BR>close(3)
= 0<BR>open("/lib/libdl.so.2", O_RDONLY)
= 3<BR>read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0\34"...,
1024) = 1024<BR>fstat64(0x3,
0x7ffff078)
= 0<BR>mmap(0xff74000, 74812, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xff74000<BR>mprotect(0xff77000, 62524, PROT_NONE) =
0<BR>mmap(0xff84000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0) =
0xff84000<BR>close(3)
= 0<BR>open("/lib/libnsl.so.1", O_RDONLY) =
3<BR>read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\0A\274"...,
1024) = 1024<BR>fstat64(0x3,
0x7ffff058)
= 0<BR>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x30017000<BR>mmap(0xff3e000, 152068, PROT_READ|PROT_EXEC, MAP_PRIVATE,
3, 0) = 0xff3e000<BR>mprotect(0xff51000, 74244, PROT_NONE) =
0<BR>mmap(0xff5e000, 12288, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x10000) = 0xff5e000<BR>mmap(0xff61000, 8708,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0)
=
0xff61000<BR>close(3)
= 0<BR>open("/lib/libc.so.6",
O_RDONLY) = 3<BR>read(3,
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\24\0\0\0\1\0\1\322"..., 1024) =
1024<BR>fstat64(0x3,
0x7ffff038)
= 0<BR>mmap(0xfddd000, 1379388, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0xfddd000<BR>mprotect(0xff16000, 97340, PROT_NONE) =
0<BR>mmap(0xff1d000, 61440, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x130000) = 0xff1d000<BR>mmap(0xff2c000, 7228,
PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0)
=
0xff2c000<BR>close(3)
=
0<BR>brk(0)
=
0x10059134<BR>brk(0x1005a134)
=
0x1005a134<BR>brk(0x1005b000)
= 0x1005b000<BR>write(2, "before init_ncurses()\n", 22) = 22<BR>write(2,
"before initscr()\n", 17) =
17<BR>access("/usr/share/terminfo/v/vt100", R_OK) =
0<BR>open("/usr/share/terminfo/v/vt100", O_RDONLY) = 3<BR>read(3,
"\32\1,\0\25\0\7\0\16\1\3\2", 12) = 12<BR>read(3, "vt100|vt100-am|dec vt100
(w/adva"..., 44) = 44<BR>read(3,
"\0\1\0\0\1\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\1", 21) = 21<BR>read(3, "\0",
1)
= 1<BR>read(3, "P\0\10\0\30\0\377\377\377\377\377\377\3\0", 14) =
14<BR>read(3,
"\377\377\0\0\2\0\4\0\25\0\32\0&\0.\0\377\377\377\3777\0"..., 540) =
540<BR>read(3, "\7\0\r\0\33[%i%p1%d;%p2%dr\0\33[3g\0\33[H\33[J"..., 515) =
515<BR>read(3, "",
1)
= 0<BR>read(3, "",
10)
=
0<BR>close(3)
= 0<BR>-- SIGSEGV (Segmentation fault) @ 0 (0) ---<BR>+++ killed by SIGSEGV
+++</FONT></DIV>
<DIV><FONT face="Times New Roman">Segmentation fault</FONT></DIV>
<DIV><FONT face="Times New Roman"></FONT> </DIV>
<DIV><FONT
face="Times New Roman"></FONT> </DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>