[PATCH] x86: Add x86_is_elf to optimize out the ELF check

H.J. Lu hjl.tools@gmail.com
Mon Sep 23 22:56:03 GMT 2024


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.

-- 
H.J.


More information about the Binutils mailing list