[PATCH] D144617: [AVR][MC] Add ELF flag 'EF_AVR_LINKRELAX_PREPARED' to OBJ files
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 23 18:53:11 PST 2023
MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.
In D144617#4149029 <https://reviews.llvm.org/D144617#4149029>, @benshi001 wrote:
> In D144617#4148171 <https://reviews.llvm.org/D144617#4148171>, @MaskRay wrote:
>
>> I think we should understand what this flag does and how it affects assemblers/linkers.
>> If it does not cause behavior difference, I am unsure we should add it.
>
> This is how gnu ld perform linker relaxation for AVR
> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elf32-avr.c;h=702719136d09acbc8c98ec49ab8129d0f33fffa8;hb=6777dece58127236db900215857f9070ad63e0bf#l2423
>
> We can see this flag `EF_AVR_LINKRELAX_PREPARED` does affect
> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elf32-avr.c;h=702719136d09acbc8c98ec49ab8129d0f33fffa8;hb=6777dece58127236db900215857f9070ad63e0bf#l2533
>
> The gnu ld will optimize long call (absolute address) to short call (PC relative address) only if this flag is set. (Of course `--relax` must also be specified.)
s/gnu ld/GNU ld/. Change the summary to say that it affects GNU ld.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144617/new/
https://reviews.llvm.org/D144617
More information about the llvm-commits
mailing list