Closed sprintersb closed 3 months ago
Test case:
$ avr-gcc main.c -mmcu=attiny102
int main (void)
{
return 0;
}
Besides the venerable AT90S1200 (which was not targetted to C), there were probably no devices without EEPROM back 10 years ago. Does that look like the correct fix?
diff --git a/crt1/gcrt1.S b/crt1/gcrt1.S
index 699aa482..a93c0f1b 100644
--- a/crt1/gcrt1.S
+++ b/crt1/gcrt1.S
@@ -365,8 +365,10 @@ __do_copy_data:
.long EEPROM_SIZE
#elif E2END > 0
.long E2END + 1
-#else
+#elif defined(E2END)
.long E2END
+#else
+ .long 0
#endif
/* String offsets table.
Index 0 - Size of offset table in bytes
Seems to fix your testcase, at least. Shall I commit it?
I think we can just
diff --git a/crt1/gcrt1.S b/crt1/gcrt1.S
index 699aa482..0e854fa4 100644
--- a/crt1/gcrt1.S
+++ b/crt1/gcrt1.S
@@ -366,7 +366,7 @@
#elif E2END > 0
.long E2END + 1
#else
- .long E2END
+ .long 0
#endif
/* String offsets table.
Index 0 - Size of offset table in bytes
Negative E2END
wouldn't make any sense.
There are other cases (flash and RAM) that look similar. Maybe we can skip that "+1" part just everywhere then?
OK, fixed. While at it, I changed the code for FLASHEND in a similar way.
done
Thanks.
This error can occur for devices without EEPROM memory, because
E2END
is added to the.note.gnu.avr.deviceinfo
section, butE2END
is never defined inavr/io.h
.This was added 2014-11-21 with 4a58441b2b5b6a347d324798c047bb8b8f439351