Since v2.2.0's implementation of issue #936, gcrt1.S defines symbols __DATA_REGION_ORIGIN__ and __DATA_REGION_LENGTH__.
These symbols are used in the default linker scripts to define the beginning and extent of the data memory region — but only since the recent implementation of PR29741 in Binutils v2.40. Prior to that, the data region started at a core specific value of $DATA_ORIGIN together with a length of __DATA_REGION_LENGTH__.
Outcome is that #936 may set the data region length to the correct length, but misses to set data origin as the linker script does not use __DATA_REGION_ORIGIN__. This may lead to errors from the linker when user data starting at -Tdata extends beyond $DATA_ORIGIN + __DATA_REGION_LENGTH__.
The user can work around this by compiling with, say, -Wl,--defsym,__DATA_REGION_LENGTH__=64k.
On the AVR-LibC side, two approaches are possible:
Issue an error during configure when Binutils without PR29741 is used.
Resort to v2.1.0 behaviour when Binutils without PR29741 is used, i.e. don't define __DATA_REGION_XXX__ in gcrt1.S. This means that gcrt1.S will depend on config.h.
Since v2.2.0's implementation of issue #936,
gcrt1.S
defines symbols__DATA_REGION_ORIGIN__
and__DATA_REGION_LENGTH__
.These symbols are used in the default linker scripts to define the beginning and extent of the data memory region — but only since the recent implementation of PR29741 in Binutils v2.40. Prior to that, the data region started at a core specific value of
$DATA_ORIGIN
together with a length of__DATA_REGION_LENGTH__
.Outcome is that #936 may set the data region length to the correct length, but misses to set data origin as the linker script does not use
__DATA_REGION_ORIGIN__
. This may lead to errors from the linker when user data starting at-Tdata
extends beyond$DATA_ORIGIN + __DATA_REGION_LENGTH__
.The user can work around this by compiling with, say,
-Wl,--defsym,__DATA_REGION_LENGTH__=64k
.On the AVR-LibC side, two approaches are possible:
__DATA_REGION_XXX__
ingcrt1.S
. This means thatgcrt1.S
will depend onconfig.h
.