Initialised Data
William A. Gatliff
bgat@billgatliff.com
Thu Jan 16 14:13:00 GMT 2003
Nicolas:
You need the AT directive.
There's an article on my website, http://billgatliff.com, that talks
about the AT directive and linker command scripts in general. The
name of the article is "An Introduction to the GNU Compiler and
Linker". URL escapes me at the moment...
Depending on how your system works, you may also need some help in
your startup code to initialize your .data memory section. The
article talks about that, too.
HTH,
b.g.
On Thu, Jan 16, 2003 at 04:55:32PM +1100, Nicolas Moreau wrote:
> Hi
>
> I am trying to understand the logic behind the initialised data segment.
> I understand that, the values should be copied from ROM to RAM by crt0.s on startup, the values normally sit after the text section.
> What gets me really confused is that in my current build where my linker script says:
> . = 0xC0000000;
> .data :
> {
> __data_start__ = .;
> *(.data)
> __data_end__ = .;
> }
> The actual values are put in 0xC0000000, my text stops at around 0x00600000.
> This has been working fine with GDB, but now that I am trying to build a binary image, objcopy complains that it can't write at 0xc0000000 (which is normal). So to create my binary image to load into the system, I have to relocate the data segment to the end of text using objcopy.
> This works but sounds very awkward, can someone tell me how this should be done ?
> Thanks
>
> Nic
>
>
>
>
>
> -------------------------------------------------
>
>
> ------
> Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
>
--
Bill Gatliff
Public embedded GNU and embedded Linux training dates announced!
http://billgatliff.com
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com
More information about the crossgcc
mailing list