Lines Matching refs:sym
30 struct symbol *sym; in checksum_debug_init() local
37 for_each_sym_by_name(file->elf, s, sym) { in checksum_debug_init()
38 if (!is_func_sym(sym) && !is_object_sym(sym)) in checksum_debug_init()
40 sym->debug_checksum = 1; in checksum_debug_init()
64 static bool is_anonymous_const_data(struct symbol *sym) in is_anonymous_const_data() argument
66 return strstarts(sym->sec->name, ".rodata.cst") && in is_anonymous_const_data()
67 (is_sec_sym(sym) || strstarts(sym->name, ".LC")); in is_anonymous_const_data()
76 struct symbol *sym; in checksum_update_insn() local
134 sym = reloc->sym; in checksum_update_insn()
137 if (is_string_sec(sym->sec)) { in checksum_update_insn()
140 str = sym->sec->data->d_buf + sym->offset + offset; in checksum_update_insn()
145 if (is_anonymous_const_data(sym)) { in checksum_update_insn()
148 cst = sym->sec->data->d_buf + sym->offset + offset; in checksum_update_insn()
149 __checksum_update_insn(func, insn, cst, sym->sec->sh.sh_entsize); in checksum_update_insn()
153 if (is_sec_sym(sym)) { in checksum_update_insn()
154 sym = find_symbol_containing(reloc->sym->sec, offset); in checksum_update_insn()
155 if (!sym) in checksum_update_insn()
158 offset -= sym->offset; in checksum_update_insn()
161 __checksum_update_insn(func, insn, sym->demangled_name, in checksum_update_insn()
162 strlen(sym->demangled_name)); in checksum_update_insn()
195 static void checksum_update_object(struct objtool_file *file, struct symbol *sym) in checksum_update_object() argument
199 __checksum_update_object(sym, 0, "len", &sym->len, sizeof(sym->len)); in checksum_update_object()
201 if (sym->sec->data->d_buf) in checksum_update_object()
202 __checksum_update_object(sym, 0, "data", in checksum_update_object()
203 sym->sec->data->d_buf + sym->offset, in checksum_update_object()
204 sym->len); in checksum_update_object()
206 sym_for_each_reloc(file->elf, sym, reloc) { in checksum_update_object()
207 unsigned long sym_offset = reloc_offset(reloc) - sym->offset; in checksum_update_object()
208 struct symbol *target = reloc->sym; in checksum_update_object()
217 __checksum_update_object(sym, sym_offset, in checksum_update_object()
223 target = find_symbol_containing(reloc->sym->sec, offset); in checksum_update_object()
230 __checksum_update_object(sym, sym_offset, "reloc name", in checksum_update_object()
233 __checksum_update_object(sym, sym_offset, "reloc addend", in checksum_update_object()
241 struct symbol *sym; in calculate_checksums() local
246 for_each_sym(file->elf, sym) { in calculate_checksums()
253 if (is_cold_func(sym) || is_alias_sym(sym) || !sym->len || in calculate_checksums()
254 !sym->sec || !sym->sec->data) in calculate_checksums()
257 if (is_func_sym(sym)) { in calculate_checksums()
258 checksum_init(sym); in calculate_checksums()
259 func_for_each_insn(file, sym, insn) in calculate_checksums()
260 checksum_update_insn(file, sym, insn); in calculate_checksums()
261 checksum_finish(sym); in calculate_checksums()
263 } else if (is_object_sym(sym)) { in calculate_checksums()
264 checksum_init(sym); in calculate_checksums()
265 checksum_update_object(file, sym); in calculate_checksums()
266 checksum_finish(sym); in calculate_checksums()
277 struct symbol *sym; in create_sym_checksum_section() local
290 for_each_sym(file->elf, sym) in create_sym_checksum_section()
291 if (sym->csum.checksum) in create_sym_checksum_section()
300 for_each_sym(file->elf, sym) { in create_sym_checksum_section()
301 if (!sym->csum.checksum) in create_sym_checksum_section()
305 sym, 0, R_TEXT64)) in create_sym_checksum_section()
310 checksum->checksum = sym->csum.checksum; in create_sym_checksum_section()