Re: [avr-libc-dev] Linker size check by adding export symbols

2017-08-05 Thread Joerg Wunsch
As Sebastian Brückner wrote:

> 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. ;-)

___
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev


[avr-libc-dev] Linker size check by adding export symbols

2017-08-05 Thread Sebastian Brückner

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 
.


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 0x 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

___
AVR-libc-dev mailing list
AVR-libc-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-libc-dev