Re: Off-by-one error in ld documentation

2015-09-11 Thread Mark Rages
On Tue, Sep 8, 2015 at 2:40 AM, Nick Clifton wrote: > Hi Hans-Peter, > >> Nicely, thanks. While there's a point in keeping just one >> version for simplicity, the educational point of "here's what >> you may write which doesn't work, here's the semantically >> corrected code, and this is what you

Re: Off-by-one error in ld documentation

2015-09-11 Thread Hans-Peter Nilsson
On Fri, 11 Sep 2015, Mark Rages wrote: > On Tue, Sep 8, 2015 at 2:40 AM, Nick Clifton wrote: > > Hi Hans-Peter, > > > >> Nicely, thanks. While there's a point in keeping just one > >> version for simplicity, the educational point of "here's what > >> you may write which doesn't work, here's the s

Re: Off-by-one error in ld documentation

2015-09-08 Thread Nick Clifton
Hi Hans-Peter, Nicely, thanks. While there's a point in keeping just one version for simplicity, the educational point of "here's what you may write which doesn't work, here's the semantically corrected code, and this is what you should have written in the first place" wins, IMHO. Good. I ha

Re: Off-by-one error in ld documentation

2015-09-07 Thread Hans-Peter Nilsson
On Mon, 7 Sep 2015, Nick Clifton wrote: > > extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[]; > > memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM); > > Actually that *is* a nicer way of writing it. With two people agreeing, it's almost an objective view. :) > But, I wrot

Re: Off-by-one error in ld documentation

2015-09-07 Thread Nick Clifton
Hi Hans-Peter, extern char start_of_ROM, end_of_ROM, start_of_FLASH; memcpy (& start_of_FLASH, & start_of_ROM, & end_of_ROM - & start_of_ROM); While we're at that example, is there a reason why it is pretending that the symbols are for variables whose address is then taken (to get the

Re: Off-by-one error in ld documentation

2015-09-05 Thread Hans-Peter Nilsson
On Thu, 3 Sep 2015, Nick Clifton wrote: > 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: >

Re: Off-by-one error in ld documentation

2015-09-03 Thread Nick Clifton
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_o