This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Querry.-- 2/5/01
- To: gcc <gcc at gcc dot gnu dot org>, Nick Clifton <nickc at cambridge dot redhat dot com>, support-sw at arm dot com, Philip Blundell <philb at gnu dot org>
- Subject: Querry.-- 2/5/01
- From: MNShukla <mnshukla at cirrus dot stpp dot soft dot net>
- Date: Thu, 03 May 2001 14:37:44 +0530
Hi,
I am compiling 2 files (init.c & data.c) by ADSv1.1 and test.c by
arm-linux-gcc. and linking all the 3 Obj's by using arm-linux-gcc linker
to generate the image. Now, I run my program on an ARM board, some time
it was working and sometimes it was giving Kernel-Panic. When I probed
it using map file, I found that whenever I access the adddress
address-range
0x0203e000 to 0x0203efff (this size is 4KB), it gives kernel panic.
In the map file, I see the address allocated to global variable
(mnglobal -- an array of type short) is 0x0203daf4. Now if I access
mnglobal[644] or mnglobal[645] it works fine (note that &mnglobal[645] =
0x0203dffe) when I access(write) at mnglobal[646] , whose address is
0x0203e000, it gives kernal-panic. This 4KB address range is consistent.
Note that if I compare the images we get variation as follows---
|----------|-------------| ------------------------- |
| Address | Image with | Image with | Image with |
| in hex | index 644 | index 645 | index 646 |
|----------|-------------|-------------| ------------|
| 224 | b8 | ba | bc |
-------------------------------------------------------
Now, if I compile init.c in arm-linux-gcc, and use the same range by the
use of map, it works fine.
What could be the problem? Can any body give me some pointer ? The 3
files are given below....
Thanks in advance....
-Mahesh
(Mahesh Narain Shukla)
---------------------------------------
filie = init.c ---- compiled on ADS v1.1
---------------------------------------
extern short mnglobal[15000];
void init(void)
{
mnglobal[645] = 1;
} /* init */
------------------------------------------
filie = data.c ----- compiled on ADS v1.1
------------------------------------------
short mnglobal[15000];
---------------------------------------------
filie = test.c ----- compiled on arm-linux-gcc
---------------------------------------------
# include <stdio.h>
extern short mnglobal[15000];
extern void init(void);
int main (void)
{
init();
mnglobal[0] = 1234 ;
printf("\n mnglobal[0] = %d\n", mnglobal[0]);
printf("\n &mnglobal[645] = %p\n", &mnglobal[645]);
}
-----------------------------------------------
All the above 3 files are linked by using arm-linux-gcc.
begin:vcard
n:SHUKLA;MAHESH NARAIN
tel;cell:98230-34282
tel;fax:+91-20-5671090
tel;home:(0532) 500198
tel;work:+91-20-5671092 (x 225)
x-mozilla-html:FALSE
org:Cirrus Logic Software (I) Pvt. Ltd
version:2.1
email;internet:mnshukla@idc.cirrus.com, mnshukla@hotmail.com, mnshukla@usa.net
title:Senior Software Engineer
adr;quoted-printable:;;106-A, MUTTHA CHAMBERS,=0D=0ASENAPATI BAPAT ROAD,=0D=0APUNE;PUNE;;;INDIA
fn:M.N.Shukla
end:vcard