[PATCH] x86: Add x86_is_elf to optimize out the ELF check
Jan Beulich
jbeulich@suse.com
Tue Sep 24 08:18:57 GMT 2024
On 24.09.2024 00:56, H.J. Lu wrote:
> Add x86_is_elf and replace IS_ELF with x86_is_elf () so that compiler
> can optimize out the ELF check when OBJ_ELF is defined and OBJ_MAYBE_ELF
> isn't defined.
>
> * config/tc-i386.c (x86_is_elf): New function.
> (check_cpu_arch_compatible): Replace IS_ELF with x86_is_elf ().
> (i386_arch): Likewise.
> (i386_mach): Likewise.
> (tc_i386_fix_adjustable): Likewise.
> (i386_assemble): Likewise.
> (need_plt32_p): Likewise.
> (x86_cleanup): Likewise.
> (output_insn): Likewise.
> (lex_got): Likewise.
> (s_insn): Likewise.
> (md_estimate_size_before_relax): Likewise.
> (md_apply_fix): Likewise.
> (md_parse_option): Likewise.
> (i386_target_format): Likewise.
> (i386_validate_fix): Likewise.
> (tc_gen_reloc): Likewise.
>
Sadly there's no actual patch, so I can only guess what it does. I think
we don't need this anymore, with the plan to do away with OBJ_MAYBE_ELF
for x86 anyway. All places you touch now would then need touching again.
And I expect to get to this within the next few weeks.
Jan
More information about the Binutils
mailing list