avrdudes / avr-libc

The AVR-LibC package provides a subset of the standard C library for AVR 8-bit RISC microcontrollers.
https://avrdudes.github.io/avr-libc/
Other
261 stars 56 forks source link

Use _VECTOR_SIZE in gcrt1.S if available #943

Closed sprintersb closed 9 months ago

sprintersb commented 9 months ago

Some I/O headers define _VECTOR_SIZE which can be used in gcrt1.S to layout the vector table.

This information is more reliable than __AVR_HAVE_JMP_CALL__ which is currently used via macros.inc's definition of XCALL/XJMP (which deviates from the definition in asmdef.h btw).

As an example, take ATmega808/9 which is currently in avrxmega3/short-calls, hence does not define __AVR_HAVE_JMP_CALL__. However according to the data sheet and iom808/9.h, _VECTOR_SIZE is 4.

sprintersb commented 9 months ago

Implemented as https://github.com/avrdudes/avr-libc/commit/c0a8ed5f0d600a1f076ad3e5cc33e2a59dc2d5ac.