Lines Matching +full:alternative +full:- +full:a
1 // SPDX-License-Identifier: GPL-2.0-or-later
15 * Recompute orig_len for nested ALTERNATIVE()s. in arch_handle_alternative()
17 if (group && group->orig_sec == alt->orig_sec && in arch_handle_alternative()
18 group->orig_off == alt->orig_off) { in arch_handle_alternative()
22 unsigned int len = max(iter->orig_len, alt->orig_len); in arch_handle_alternative()
23 iter->orig_len = alt->orig_len = len; in arch_handle_alternative()
38 * If UACCESS validation is enabled; force that alternative; in arch_handle_alternative()
42 * alternative code flow at the same time, in that case we can in arch_handle_alternative()
47 alt->skip_orig = true; in arch_handle_alternative()
49 alt->skip_alt = true; in arch_handle_alternative()
54 * feature path which is a "very very small percentage of in arch_handle_alternative()
57 alt->skip_orig = true; in arch_handle_alternative()
76 * This is the most common case by far. It jumps to an address in a simple
81 * This is caused by a rare GCC quirk, currently only seen in three driver
82 * functions in the kernel, only with certain obscure non-distro configs.
84 * As part of an optimization, GCC makes a copy of an existing switch jump
85 * table, modifies it, and then hard-codes the jump (albeit with an indirect
86 * jump) to use a single entry in the table. The rest of the jump table and
89 * In such a case we can just crudely ignore all unreachable instruction
91 * for the function, but that would require redesigning the code quite a
93 * warnings are of questionable value anyway, and this is such a rare issue.
99 * This is a fairly uncommon pattern which is new for GCC 6. As of this
102 * As of GCC 7 there are quite a few more of these and the 'in between' code
118 /* look for a relocation which references .rodata */ in arch_find_switch_table()
119 text_reloc = find_reloc_by_dest_range(file->elf, insn->sec, in arch_find_switch_table()
120 insn->offset, insn->len); in arch_find_switch_table()
121 if (!text_reloc || text_reloc->sym->type != STT_SECTION || in arch_find_switch_table()
122 !text_reloc->sym->sec->rodata) in arch_find_switch_table()
126 table_sec = text_reloc->sym->sec; in arch_find_switch_table()
132 * Make sure the .rodata address isn't associated with a in arch_find_switch_table()
141 strcmp(table_sec->name, C_JUMP_TABLE_SECTION)) in arch_find_switch_table()
145 * Each table entry has a rela associated with it. The rela in arch_find_switch_table()
149 rodata_reloc = find_reloc_by_dest(file->elf, table_sec, table_offset); in arch_find_switch_table()
154 * Use of RIP-relative switch jumps is quite rare, and in arch_find_switch_table()
155 * indicates a rare GCC quirk/bug which can leave dead in arch_find_switch_table()
159 file->ignore_unreachables = true; in arch_find_switch_table()