This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld generates invalid addresses


On 05/14/2012 05:49 AM, Alan Modra wrote:
On Sun, May 13, 2012 at 03:21:48PM +0200, Niklas Gürtler wrote:
from the program memory. The problem is now, that the _sidata label
is set incorrectly - in my case, the initialization data in the
flash begins at addess 0x080021b0 (placed there by ld), so ld should
set _sidata to exactly that address, but it sets it to 0x080021ac.
Why must ld do that? You have

_sidata = .;

   .data :
   {
     . = ALIGN(4);
   ...

.data may be at a different address due to alignment of .data, or ld
may have inserted an orphan section between the assignment and .data.

Probably your best option is to use
   _sidata = ADDR (.data);
Put this somewhere after the .data section.

Oh, you are right. Apparantly, it has to be LOADADDR(.data); because I need the address in the flash memory, not the RAM. Thank you very much for your help!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]