bug-binutils
[Top][All Lists]
Advanced

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

Re: Off-by-one error in ld documentation


From: Nick Clifton
Subject: Re: Off-by-one error in ld documentation
Date: Thu, 3 Sep 2015 16:50:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

Hi Mark,

In ld/ld.texinfo, the following example code is offered:

  start_of_ROM   = .ROM;
  end_of_ROM     = .ROM + sizeof (.ROM) - 1;
  start_of_FLASH = .FLASH;

Then the C source code to perform the copy would be:

  extern char start_of_ROM, end_of_ROM, start_of_FLASH;

  memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - & start_of_ROM);

But I think this does not copy the last byte of ROM due to the -1 in
the end_of_ROM definition.

Thanks for pointing this out. I have checked in the obvious fix to the documentation.

Cheers
  Nick





reply via email to

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