linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Static linking /Shared Library  Application Errors.
@ 2003-08-05 13:11 rekha gvv
  2003-08-05 13:21 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: rekha gvv @ 2003-08-05 13:11 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: wd


Hello ,
I am trying to execute certain fileutils application
like cp ,ls ..
These applications are compiled using the Glibc 2.2.3

The problem is if i compile the applications
Statically
and try to execute the command cp,ls ..i get the
segmentation fault error.Please let me know the proper
compiler options  for static linking.

the make file i have used is as follows

-----------------------------------------------------
CC=powerpc-linux-gcc
CFLAGS=-msoft-float -D_SOFT_FLOAT -mcpu=860
LDLIBS=
LDFLAGS+=--static

EXECS = cat chgrp chmod chown cmp cp dd grep l ln ls
mkdir mkfifo mknod \
        more mv rm rmdir sync touch vi
OBJS = cat.o chgrp.o chmod.o chown.o cmp.o cp.o dd.o
grep.o l.o ln.o ls.o \
        mkdir.o mkfifo.o mknod.o more.o mv.o rm.o
rmdir.o sync.o touch.o vi.o

all: $(EXECS)

$(EXECS): $(OBJS)
        $(CC) $(LDFLAGS) -o $@ $@.o $(LDLIBS)



----------------------------------------------------

Then i tried to eliminate the problem by using shared
library that is put the ld.so.1 file and libc.so.6
file in the /lib directory of the ramdisk .
The problem is the library files are too big in size.
libc is 5.1mb and ld.so.1 is .5mb

inorder to create a ramdisk image i have used the
initrd.sudo scrip file form the denx SELF package.
: ${IRD_SIZE:=4096k}

dd if=/dev/zero of=$IMAGE bs=$IRD_SIZE count=1
2>/dev/null

If the IRD_SIZE is 4096 then the ramdisk image does
not get created since the library file is too big so i
changed it too 8192k then a proper ramdisk image is
created.
but then when i create the kernel Multi image and
download it i get the following error .
------------------------------------------------------
RAMDISK driver initialized: 16 RAM disks of 4096K size
1024 blocksize
eth0: CPM ENET Version 0.2 on SCC1, 00:d0:93:00:12:34
RAMDISK: Compressed image found at block 0
Kernel panic: Out of memory and no killable
processes...

Rebooting in 180 seconds..
------------------------------------------------------
I have tried to increse the ramdisk size by setting
default ramdisk size to 8192 in the kernel menu config
option ..but still same error.

So please tell me which is the best method ..and also
the remedies for the above problem.
1.should i use statick linking
2.shared library ..

Thanking you

Regards,
Rekha.c


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Static linking /Shared Library Application Errors.
  2003-08-05 13:11 Static linking /Shared Library Application Errors rekha gvv
@ 2003-08-05 13:21 ` Wolfgang Denk
  2003-08-07  6:53   ` kernel boot up without using PPCBOOT from flash rekha gvv
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2003-08-05 13:21 UTC (permalink / raw)
  To: rekha gvv; +Cc: linuxppc-embedded


In message <20030805131112.59750.qmail@web8007.mail.in.yahoo.com> you wrote:
>
> I am trying to execute certain fileutils application
> like cp ,ls ..
> These applications are compiled using the Glibc 2.2.3
>
> The problem is if i compile the applications
> Statically
> and try to execute the command cp,ls ..i get the
> segmentation fault error.Please let me know the proper
> compiler options  for static linking.

Please explain which toolchain you are yusing, which  libraries,  and
which versions of the tools listed above.

> OBJS = cat.o chgrp.o chmod.o chown.o cmp.o cp.o dd.o
> grep.o l.o ln.o ls.o \
>         mkdir.o mkfifo.o mknod.o more.o mv.o rm.o
> rmdir.o sync.o touch.o vi.o

Where did you get these object files from?

I have a suspicion that these are  in  fact  parets  of  the  busybox
toolbox.  If  this  is  correct,  then  why  don't you simply use the
Makefile that comes with busybox?

> Then i tried to eliminate the problem by using shared
> library that is put the ld.so.1 file and libc.so.6
> file in the /lib directory of the ramdisk .
> The problem is the library files are too big in size.
> libc is 5.1mb and ld.so.1 is .5mb

You can strip the shared libraries for the target.

> inorder to create a ramdisk image i have used the
> initrd.sudo scrip file form the denx SELF package.
> : ${IRD_SIZE:=4096k}
>
> dd if=/dev/zero of=$IMAGE bs=$IRD_SIZE count=1
> 2>/dev/null

Again, I have the suspicion  that  this  code  comes  from  our  SELF
package.  The  scripts provided by SELF take care of all the problems
you are running in.

> 1.should i use statick linking

No, this will most probably just increasy your memory footprint.

> 2.shared library ..

Yes.

What I don't understand: there is a working set of tools and scripts.
You rip it apart, omit essential parts, and then complain that it  is
not working any more.

What else did you expect?

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
It is surely a great calamity for  a  human  being  to  have  no  ob-
sessions.                                                - Robert Bly

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* kernel boot up without using PPCBOOT from flash
  2003-08-05 13:21 ` Wolfgang Denk
@ 2003-08-07  6:53   ` rekha gvv
  0 siblings, 0 replies; 5+ messages in thread
From: rekha gvv @ 2003-08-07  6:53 UTC (permalink / raw)
  To: linuxppc-embedded


Thanks ,

I was able to solve the staic/shared library problem
by just stripping out the libraries and including them
in the ramdisk .

Now i need to go ahead with booting the kernel without
using PPCBOOT as soon as the power is on.
I dont know from where to start and which files i need
to modify ..
So please help me to go ahead with your suggestions
how to boot kernel from flash ?

Thankyou!

--- Wolfgang Denk <wd@denx.de> wrote:
>
> In message
>
<20030805131112.59750.qmail@web8007.mail.in.yahoo.com>
> you wrote:
> >
> > I am trying to execute certain fileutils
> application
> > like cp ,ls ..
> > These applications are compiled using the Glibc
> 2.2.3
> >
> > The problem is if i compile the applications
> > Statically
> > and try to execute the command cp,ls ..i get the
> > segmentation fault error.Please let me know the
> proper
> > compiler options  for static linking.
>
> Please explain which toolchain you are yusing, which
>  libraries,  and
> which versions of the tools listed above.
>
> > OBJS = cat.o chgrp.o chmod.o chown.o cmp.o cp.o
> dd.o
> > grep.o l.o ln.o ls.o \
> >         mkdir.o mkfifo.o mknod.o more.o mv.o rm.o
> > rmdir.o sync.o touch.o vi.o
>
> Where did you get these object files from?
>
> I have a suspicion that these are  in  fact  parets
> of  the  busybox
> toolbox.  If  this  is  correct,  then  why  don't
> you simply use the
> Makefile that comes with busybox?
>
> > Then i tried to eliminate the problem by using
> shared
> > library that is put the ld.so.1 file and libc.so.6
> > file in the /lib directory of the ramdisk .
> > The problem is the library files are too big in
> size.
> > libc is 5.1mb and ld.so.1 is .5mb
>
> You can strip the shared libraries for the target.
>
> > inorder to create a ramdisk image i have used the
> > initrd.sudo scrip file form the denx SELF package.
> > : ${IRD_SIZE:=4096k}
> >
> > dd if=/dev/zero of=$IMAGE bs=$IRD_SIZE count=1
> > 2>/dev/null
>
> Again, I have the suspicion  that  this  code  comes
>  from  our  SELF
> package.  The  scripts provided by SELF take care of
> all the problems
> you are running in.
>
> > 1.should i use statick linking
>
> No, this will most probably just increasy your
> memory footprint.
>
> > 2.shared library ..
>
> Yes.
>
> What I don't understand: there is a working set of
> tools and scripts.
> You rip it apart, omit essential parts, and then
> complain that it  is
> not working any more.
>
> What else did you expect?
>
> Best regards,
>
> Wolfgang Denk
>
> --
> Software Engineering:  Embedded and Realtime
> Systems,  Embedded Linux
> Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88
> Email: wd@denx.de
> It is surely a great calamity for  a  human  being
> to  have  no  ob-
> sessions.
>     - Robert Bly
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kernel boot up without using PPCBOOT from flash
       [not found] <20030808054849.E1CC3C59E4@atlas.denx.de>
@ 2003-08-09 11:19 ` rekha gvv
  2003-08-09 22:22   ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: rekha gvv @ 2003-08-09 11:19 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1900 bytes --]


Hello.

> Just write the Linux kernel image to flash and
> start it from flash using PPCBoot. See also:
> http://www.denx.de/twiki/bin/view/DULG/LinuxInFlash

I wrote the pMulti image into flash 2a00000
ppcboot is at location 2800000
i did the following settings
setenv bootcmd bootm 0x2a00000
and also  did saveenv ...
once i reset the board it just hangs thats it...
even ppcboot promp does not come ..
i have to burn ppcboot again and again in that case ..
i want the kernel to boot up upon power ..
but here even the existing ppcboot doesnt work ..

this is the fliinfo

=>flinfo

Bank # 1: AMD 29F040 or 29LV040 (4 Mbit, uniform
sectors)
  Size: 2 MB in 8 Sectors
  Sector Start Addresses:
    02800000 (RO) 02840000 (RO) 02880000      028C0000
     02900000
    02940000      02980000      029C0000

Bank # 2: AMD 29F040 or 29LV040 (4 Mbit, uniform
sectors)
  Size: 2 MB in 8 Sectors
  Sector Start Addresses:
    02A00000      02A40000      02A80000      02AC0000
     02B00000
    02B40000      02B80000      02BC0000

Bank # 3: AMD 29F040 or 29LV040 (4 Mbit, uniform
sectors)
  Size: 2 MB in 8 Sectors
  Sector Start Addresses:
    02C00000      02C40000      02C80000      02CC0000
     02D00000
    02D40000      02D80000      02DC0000

Bank # 4: AMD 29F040 or 29LV040 (4 Mbit, uniform
sectors)
  Size: 2 MB in 8 Sectors
  Sector Start Addresses:
    02E00000      02E40000      02E80000      02EC0000
     02F00000
    02F40000      02F80000      02FC0000


Bytes transferred = 1685861 (19b965 hex)
=>cp.b 400000 2a00000 19b966
Copy to Flash... done
=>setenv bootcmd bootm 2a00000
=>saveenv
Saving Enviroment to Flash...
Un-Protected 1 sectors
Erasing Flash...
. done
Erased 1 sectors
Writing to Flash... done
Protected 1 sectors
=>Ã  it hangs  at this point.
 how do i go about this problem ?

thanks reagrds

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kernel boot up without using PPCBOOT from flash
  2003-08-09 11:19 ` rekha gvv
@ 2003-08-09 22:22   ` Wolfgang Denk
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2003-08-09 22:22 UTC (permalink / raw)
  To: rekha gvv; +Cc: linuxppc-embedded


In message <20030809111908.47795.qmail@web8005.mail.in.yahoo.com> you wrote:
>
> I wrote the pMulti image into flash 2a00000
> ppcboot is at location 2800000
> i did the following settings
> setenv bootcmd bootm 0x2a00000
> and also  did saveenv ...
> once i reset the board it just hangs thats it...

This description does NOT match the log you show below:

> =>setenv bootcmd bootm 2a00000
> =>saveenv
> Saving Enviroment to Flash...
> Un-Protected 1 sectors
> Erasing Flash...
> . done
> Erased 1 sectors
> Writing to Flash... done
> Protected 1 sectors
> =>Ã  it hangs  at this point.
>  how do i go about this problem ?

Judging from this output it seems that the board hangs as soon as you
performed the "saveenv" command. Where is the environment  stored  on
your  board? To me this looks like the environment placement for your
board was not configured correctly in U-Boot.

Umm... but this is off topic here.  Let's  move  this  discussion  to
u-boot-users, please.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
"On two occasions I have been  asked  [by  members  of  Parliament!],
'Pray,  Mr.  Babbage, if you put into the machine wrong figures, will
the right answers come out?' I am not able rightly to  apprehend  the
kind of confusion of ideas that could provoke such a question."
- Charles Babbage

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-09 22:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-05 13:11 Static linking /Shared Library Application Errors rekha gvv
2003-08-05 13:21 ` Wolfgang Denk
2003-08-07  6:53   ` kernel boot up without using PPCBOOT from flash rekha gvv
     [not found] <20030808054849.E1CC3C59E4@atlas.denx.de>
2003-08-09 11:19 ` rekha gvv
2003-08-09 22:22   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).