Lines Matching refs:ehdr
177 static int append_func(Elf_Ehdr *const ehdr, in append_func() argument
191 unsigned const old_shnum = w2(ehdr->e_shnum); in append_func()
192 uint_t const old_shoff = _w(ehdr->e_shoff); in append_func()
207 if (uwrite(old_shstr_sh_offset + (void *)ehdr, old_shstr_sh_size) < 0) in append_func()
216 if (uwrite(old_shoff + (void *)ehdr, in append_func()
257 ehdr->e_shoff = _w(new_e_shoff); in append_func()
258 ehdr->e_shnum = w2(2 + w2(ehdr->e_shnum)); /* {.rel,}__mcount_loc */ in append_func()
261 if (uwrite(ehdr, sizeof(*ehdr)) < 0) in append_func()
289 Elf_Ehdr const *const ehdr, in get_sym_str_and_relp() argument
294 Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) in get_sym_str_and_relp()
295 + (void *)ehdr); in get_sym_str_and_relp()
300 + (void *)ehdr); in get_sym_str_and_relp()
303 + (void *)ehdr); in get_sym_str_and_relp()
306 + (void *)ehdr); in get_sym_str_and_relp()
320 Elf_Ehdr const *const ehdr, in sift_rel_mcount() argument
335 get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp); in sift_rel_mcount()
368 Elf_Ehdr const *const ehdr, in nop_mcount() argument
371 Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) in nop_mcount()
372 + (void *)ehdr); in nop_mcount()
383 get_sym_str_and_relp(relhdr, ehdr, &sym0, &str0, &relp); in nop_mcount()
393 ret = make_nop((void *)ehdr, _w(shdr->sh_offset) + _w(relp->r_offset)); in nop_mcount()
412 if (ulseek((void *)relp - (void *)ehdr, SEEK_SET) < 0) in nop_mcount()
437 Elf_Ehdr const *const ehdr) in find_secsym_ndx() argument
440 + (void *)ehdr); in find_secsym_ndx()
452 if (w2(ehdr->e_machine) == EM_ARM in find_secsym_ndx()
521 static int do_func(Elf_Ehdr *const ehdr, char const *const fname, in do_func() argument
524 Elf_Shdr *const shdr0 = (Elf_Shdr *)(_w(ehdr->e_shoff) in do_func()
525 + (void *)ehdr); in do_func()
526 unsigned const nhdr = w2(ehdr->e_shnum); in do_func()
527 Elf_Shdr *const shstr = &shdr0[w2(ehdr->e_shstrndx)]; in do_func()
529 + (void *)ehdr); in do_func()
580 ehdr); in do_func()
587 relhdr, ehdr, recsym, recval, reltype); in do_func()
593 if (nop_mcount(relhdr, ehdr, txtname) < 0) { in do_func()
600 result = append_func(ehdr, shstr, mloc0, mlocp, mrel0, mrelp, in do_func()