[U-Boot-Users] u-boot BOOTELF clearing SHT_NOBITS sections

Chetan Nanda chetannanda at gmail.com
Sun May 4 16:07:55 CEST 2008


Hi,
Similar problem I have also faced, We used bootelf to boot a big image
(really big around 7.5 MB ELF image).
Situation is like this, We have 32 MB of RAM in our board. And we load
this image via TFTP to lower memory , but when i do bootelf, some how
BSS section is getting overlapped with the starting of the memory
where i had load the elf image using TFTP earlier.
Thus initial portion of ELF (at least ELF header) is getting cleared,
and As you know ELF header is containing the information about the
location where to jump. So my control is jumping to 0x00000000
location.
In order to solve this problem I save this address (entry point) in a
local variable and jumped to that location.
I think cmd_elf.c need some modification, and I was thinking of
sending a patch to this problem


Thanks,
Chetan Nanda

On Sun, May 4, 2008 at 2:19 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> On Sunday 04 May 2008, Baruch Cochavy wrote:
>
> > Many thanks for the quick reply/comments. Please allow me to explain: I
>  > try to bootelf from ELF bits residing in a region of memory (address
>  > range) that partially overlaps the loaded code .bss (the ELFs bits just
>  > happen to reside in that specific memory region that will eventually
>  > become the .bss by pure coincidence of address selection.)
>
>  converting the ELF into a bootable U-Boot image may work better ...
>
>
>  > Of course, a section of memory outside the reach of the application can
>  > be found to hold the ELF bits. Unfortunately, this also wastes valuable
>  > RAM bits (the Elf bits get downloaded; they are at no stage ROM
>  > resident), or will otherwise require some run-time memory layout
>  > calculation trickery I would rather avoid.
>
>  as soon as you say "load an ELF", you've already agreed to waste space.  the
>  ELF itself is full of information that is not needed at all.  this is why we
>  have the bootable U-Boot format.  or you convert it to binary using objcopy,
>  and just execute that.
>
>
>  > And a final note: try as I may, I could find no specific reference (ABI
>  > or otherwise) to indicate whose responsibility is it to clear the .bss.
>  > As for u-boot, I assume any change here would break things working
>  > today. Possibly, a bootelf invocation option would be nice....
>
>  i would be willing to bet that there is no document anywhere.  there are
>  general guidelines, but really the only requirement as i mentioned is that as
>  soon as you do start executing C, the C runtime environment must have been
>  fully initialized.  some people think the crt objects (either from the
>  toolchain or hand written) should do it.  others think the ELF loader should
>  be doing it.
>  -mike
>
> -------------------------------------------------------------------------
>  This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
>  Don't miss this year's exciting event. There's still time to save $100.
>  Use priority code J8TL2D2.
>  http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
>  U-Boot-Users mailing list
>  U-Boot-Users at lists.sourceforge.net
>  https://lists.sourceforge.net/lists/listinfo/u-boot-users
>
>




More information about the U-Boot mailing list