Discussion:
[avr-libc-dev] Linker size check by adding export symbols
Sebastian Brückner
2017-08-05 13:59:54 UTC
Permalink
Hi all,

I wanted to have automatic size checking of the .data segement. I tried
to modify gcrt1.S as I saw in an older message
<https://lists.gnu.org/archive/html/avr-libc-dev/2016-03/msg00003.html>.

See patch below. Is this the right way to do it?

Index: avr-libc/crt1/gcrt1.S
===================================================================
--- avr-libc/crt1/gcrt1.S (Revision 2544)
+++ avr-libc/crt1/gcrt1.S (Arbeitskopie)
@@ -379,5 +379,19 @@
values are picked up from the device header file.
*/

+ .weak __TEXT_REGION_LENGTH__
+ .set __TEXT_REGION_LENGTH__, FLASHEND
+
+ /* The data size check does not work on devices that support
+ external SRAM since XRAMEND will be defined to 0xFFFF in that case.
+ Linker scripts have start of .data section hardcoded to 0x60,
+ RAMSTART is not used.
+ */
+ .weak __DATA_REGION_LENGTH__
+ .set __DATA_REGION_LENGTH__, (XRAMEND - 0x60)
+
+ .weak __EEPROM_REGION_LENGTH__
+ .set __EEPROM_REGION_LENGTH__, E2END
+
.weak __FUSE_REGION_LENGTH__
.set __FUSE_REGION_LENGTH__, FUSE_MEMORY_SIZE


Best regards
Sebastian
Joerg Wunsch
2017-08-05 14:15:34 UTC
Permalink
Post by Sebastian Brückner
See patch below. Is this the right way to do it?
I think so, yes.
--
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)
Loading...