[AVR][clang] Pass the address of the data section to the linker for ATmega328
This patch modifies the Clang AVR toolchain so that it always passes the '-Tdata=0x800100' to the linker for ATmega328 devices. This matches AVR-GCC behaviour, and also corresponds to the address of the start of the data section in data space according to the ATmega328 datasheet. Without this, clang does not produce a valid ATmega328 binary. When targeting all non-ATmega328 chips, a warning will be emitted due to the fact that proper handling for the chips data section address is not yet implemented. I've held off adding other microcontrollers for now, mostly because the AVR toolchain logic is smeared across LLVM core TableGen files, and two Clang libraries. The 'family detection' logic is also only implemented for ATmega328 at the moment, for similar reasons. In the future, I aim to write an RFC to llvm-dev to find a better way for LLVM to expose target-specific details such as these to compiler frontends. Differential Revision: https://reviews.llvm.org/D86629
Loading
Please sign in to comment