[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Off-by-one error in ld documentation
From: |
Mark Rages |
Subject: |
Off-by-one error in ld documentation |
Date: |
Wed, 2 Sep 2015 11:21:33 -0600 |
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.
Regards,
Mark
address@hidden
- Off-by-one error in ld documentation,
Mark Rages <=
- Re: Off-by-one error in ld documentation, Nick Clifton, 2015/09/03
- Re: Off-by-one error in ld documentation, Hans-Peter Nilsson, 2015/09/05
- Re: Off-by-one error in ld documentation, Nick Clifton, 2015/09/07
- Re: Off-by-one error in ld documentation, Hans-Peter Nilsson, 2015/09/07
- Re: Off-by-one error in ld documentation, Nick Clifton, 2015/09/08
- Re: Off-by-one error in ld documentation, Mark Rages, 2015/09/11
- Re: Off-by-one error in ld documentation, Hans-Peter Nilsson, 2015/09/11