[AVR][MC] Add ELF flag 'EF_AVR_LINKRELAX_PREPARED' to OBJ files
authorBen Shi <powerman1st@163.com>
Thu, 23 Feb 2023 07:06:38 +0000 (15:06 +0800)
committerBen Shi <powerman1st@163.com>
Fri, 24 Feb 2023 03:16:42 +0000 (11:16 +0800)
commit366d34b39e432abff724f644adbff8d627d6f27c
tree97109c81459cec5f22f089628a9ec1716f56f295
parente758215e06f47833803580bc260e00137d4b24d9
[AVR][MC] Add ELF flag 'EF_AVR_LINKRELAX_PREPARED' to OBJ files

This is in accordance with avr-gcc, even '-mno-relax' is specified
to avr-gcc, this flag will also be added to the output relocatables.

With this flag set, the GNU ld will perform long call -> short call
optimization for AVR, otherwise not.

Fixes https://github.com/llvm/llvm-project/issues/54508

Reviewed By: MaskRay, jacquesguan, aykevl

Differential Revision: https://reviews.llvm.org/D144617
lld/test/ELF/avr-flags.s
lld/test/ELF/linkerscript/avr5.test
llvm/lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp
llvm/test/MC/AVR/elf_header.s [new file with mode: 0644]