[binutils-gdb] AVR Linker: Allow the start of the data region to specified on the command line.
Nick Clifton
nickc@sourceware.org
Thu Nov 3 09:18:20 GMT 2022
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=fa6895ad35ebfa6a9e69808da0bae249d9b8a638
commit fa6895ad35ebfa6a9e69808da0bae249d9b8a638
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Nov 3 09:17:41 2022 +0000
AVR Linker: Allow the start of the data region to specified on the command line.
PR 29471
* scripttempl/avr.sc (__DATA_REGION_ORIGIN__): Define. If a value
has not been provided on the command line then use DATA_ORIGIN.
(MEMORY): Use __DATA_REGION_ORIGIN__ as the start of the data region.
Diff:
---
ld/ChangeLog | 7 +++++++
ld/scripttempl/avr.sc | 4 +++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9ba8cbcfd0b..af1f5578b70 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2022-11-03 Nick Clifton <nickc@redhat.com>
+
+ PR 29471
+ * scripttempl/avr.sc (__DATA_REGION_ORIGIN__): Define. If a value
+ has not been provided on the command line then use DATA_ORIGIN.
+ (MEMORY): Use __DATA_REGION_ORIGIN__ as the start of the data region.
+
2022-10-21 Nick Clifton <nickc@redhat.com>
PR 29654
diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
index 026871fc6cf..f8e690d3533 100644
--- a/ld/scripttempl/avr.sc
+++ b/ld/scripttempl/avr.sc
@@ -28,7 +28,9 @@ EOF
test -n "${RELOCATING}" && cat <<EOF
__TEXT_REGION_LENGTH__ = DEFINED(__TEXT_REGION_LENGTH__) ? __TEXT_REGION_LENGTH__ : $TEXT_LENGTH;
+__DATA_REGION_ORIGIN__ = DEFINED(__DATA_REGION_ORIGIN__) ? __DATA_REGION_ORIGIN__ : $DATA_ORIGIN;
__DATA_REGION_LENGTH__ = DEFINED(__DATA_REGION_LENGTH__) ? __DATA_REGION_LENGTH__ : $DATA_LENGTH;
+
${EEPROM_LENGTH+__EEPROM_REGION_LENGTH__ = DEFINED(__EEPROM_REGION_LENGTH__) ? __EEPROM_REGION_LENGTH__ : $EEPROM_LENGTH;}
__FUSE_REGION_LENGTH__ = DEFINED(__FUSE_REGION_LENGTH__) ? __FUSE_REGION_LENGTH__ : $FUSE_LENGTH;
__LOCK_REGION_LENGTH__ = DEFINED(__LOCK_REGION_LENGTH__) ? __LOCK_REGION_LENGTH__ : $LOCK_LENGTH;
@@ -38,7 +40,7 @@ ${RODATA_PM_OFFSET+__RODATA_PM_OFFSET__ = DEFINED(__RODATA_PM_OFFSET__) ? __RODA
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = __TEXT_REGION_LENGTH__
- data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = __DATA_REGION_LENGTH__
+ data (rw!x) : ORIGIN = __DATA_REGION_ORIGIN__, LENGTH = __DATA_REGION_LENGTH__
${EEPROM_LENGTH+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = __EEPROM_REGION_LENGTH__}
$FUSE_NAME (rw!x) : ORIGIN = 0x820000, LENGTH = __FUSE_REGION_LENGTH__
lock (rw!x) : ORIGIN = 0x830000, LENGTH = __LOCK_REGION_LENGTH__
More information about the Binutils-cvs
mailing list