[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] problem after relocate code to fix address

From: zhao abl
Subject: Re: [avr-gcc-list] problem after relocate code to fix address
Date: Mon, 12 Dec 2005 02:50:11 +0000

I test my project in AVR Studio4 + WINAVR.
Now i think it is the problem of the simulator .
when i simulate the .HEX file,it works good.
but when i simulate the .ELF file,the .data section can't be
initialized correctly. In the disassembler window ,i found that the "load_data" has been placed at "0x2034"(word address),
so i think something is wrong with the simulator.:)

From: Erik Christiansen <address@hidden>
To: zhao abl <address@hidden>
CC: address@hidden
Subject: Re: [avr-gcc-list] problem after relocate code to fix address
Date: Fri, 9 Dec 2005 18:22:59 +1100

On Fri, Dec 09, 2005 at 03:12:39AM +0000, zhao abl wrote:
>    void putcinstr(uint8_t) __attribute__((section(".putsec")));
>    Wl,--section-start=.putsec=0x4000
>  After i relocate a function to a fix address ,the .data section
> can't be initialized correctly,all .data section has been initialized
> with "0xff".
>  In the .map file:
>      0x000004de                __data_load_start = LOADADDR (.data)
>      0x000004e8                __data_load_end = (__data_load_start +
> SIZEOF (.data))
>  it seems that ,__data_load_start from 0x04de, but actually there is
> nothing but "0xff".
> the "load_data" has been placed at "0x2034"(word address),just followed
> relocated founction.

Can you please post the output of "avr-objdump -h your_object_file" ?
It would be useful to provide this for the case where
--section-start=.putsec=0x4000, and again with no .putsec. We can then
see if there really is some interference.

The limited information available so far shows that the LMA of .data is
indeed 0x04de. Where do you see '"0x2034"(word address)'?
(In any case, when fiddling with the linker, it is better to work
exclusively in byte adresses. It avoids confusion. ;-)


PS: The weekend starts any minute now. It'll be two days before I see your

与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn

reply via email to

[Prev in Thread] Current Thread [Next in Thread]