1.1 --- a/lib/payload.c Fri Oct 26 20:51:25 2018 +0200
1.2 +++ b/lib/payload.c Fri Oct 26 22:27:46 2018 +0200
1.3 @@ -19,11 +19,19 @@
1.4
1.5 #include <stdint.h>
1.6
1.7 +extern uint8_t _data_original, _data;
1.8 +
1.9 +/* This is defined using SIZEOF and its table entry contains the actual value.
1.10 + Its "address" provided by the table is therefore the value! */
1.11 +
1.12 +extern uint32_t _data_size;
1.13 +
1.14 /* Relocate the .data section's contents to initialise mutable structures. */
1.15
1.16 -void relocate_data(uint8_t *original, uint8_t *current, uint32_t size)
1.17 +void relocate_data(void)
1.18 {
1.19 - uint8_t *limit = original + size;
1.20 + uint8_t *original = &_data_original, *current = &_data,
1.21 + *limit = original + (uint32_t) &_data_size;
1.22
1.23 /* Copy data from program memory to the relocated data area in RAM. */
1.24