Lines Matching defs:lf

78 	struct linker_file lf;		/* Common fields */
148 static int link_elf_lookup_debug_symbol_ctf(linker_file_t lf,
211 typedef int (*elf_reloc_fn)(linker_file_t lf, Elf_Addr relocbase,
377 link_elf_invoke_ctors(linker_file_t lf)
379 KASSERT(lf->ctors_invoked == LF_NONE,
381 __func__, lf->filename, lf->ctors_invoked));
383 link_elf_invoke_cbs(lf->ctors_addr, lf->ctors_size);
384 lf->ctors_invoked = LF_CTORS;
392 link_elf_link_common_finish(linker_file_t lf)
395 elf_file_t ef = (elf_file_t)lf;
401 error = elf_cpu_load_file(lf);
407 ef->gdb.l_addr = lf->address;
408 newfilename = malloc(strlen(lf->filename) + 1, M_LINKER, M_WAITOK);
409 strcpy(newfilename, lf->filename);
417 link_elf_invoke_ctors(lf);
682 error = link_elf_lookup_set(&ef->lf, "pcpu", (void ***)&ef->pcpu_start,
695 "linker script\n", ef->lf.pathname);
704 ef->lf.pathname, pad, LS_PADDING);
720 __func__, size, ef->lf.pathname);
743 error = link_elf_lookup_set(&ef->lf, "vnet", (void ***)&ef->vnet_start,
756 "linker script\n", ef->lf.pathname);
765 ef->lf.pathname, pad, LS_PADDING);
781 __func__, size, ef->lf.pathname);
838 link_elf_locate_exidx(linker_file_t lf, Elf_Shdr *shdr, int nhdr)
844 lf->exidx_addr = shdr[i].sh_addr + lf->address;
845 lf->exidx_size = shdr[i].sh_size;
858 link_elf_locate_exidx_preload(struct linker_file *lf, caddr_t modptr)
869 link_elf_locate_exidx(lf, shdr, nhdr);
884 linker_file_t lf;
903 lf = linker_make_file(filename, &link_elf_class);
904 if (lf == NULL)
907 ef = (elf_file_t) lf;
916 lf->address = ef->address;
917 lf->size = *(size_t *)sizeptr;
924 lf->ctors_addr = ef->address + *ctors_addrp;
925 lf->ctors_size = *ctors_sizep;
929 link_elf_locate_exidx_preload(lf, modptr);
942 linker_file_unload(lf, LINKER_UNLOAD_FORCE);
945 link_elf_reloc_local(lf);
946 *result = lf;
951 link_elf_link_preload_finish(linker_file_t lf)
956 ef = (elf_file_t) lf;
964 return (link_elf_link_common_finish(lf));
989 linker_file_t lf;
999 lf = NULL;
1128 lf = linker_make_file(filename, &link_elf_class);
1129 if (lf == NULL) {
1134 ef = (elf_file_t) lf;
1201 lf->address = ef->address;
1202 lf->size = mapsize;
1215 link_elf_reloc_local(lf);
1218 error = linker_load_dependencies(lf);
1291 lf->ctors_addr = mapbase + shdr[i].sh_addr - base_vaddr;
1292 lf->ctors_size = shdr[i].sh_size;
1324 link_elf_locate_exidx(lf, shdr, hdr->e_shnum);
1327 error = link_elf_link_common_finish(lf);
1331 *result = lf;
1336 if (error != 0 && lf != NULL)
1337 linker_file_unload(lf, LINKER_UNLOAD_FORCE);
1346 elf_relocaddr(linker_file_t lf, Elf_Addr x)
1350 KASSERT(lf->ops->cls == (kobj_class_t)&link_elf_class,
1351 ("elf_relocaddr: unexpected linker file %p", lf));
1353 ef = (elf_file_t)lf;
1461 if (reloc(&ef->lf, (Elf_Addr)ef->address, \
1513 link_elf_lookup_symbol1(linker_file_t lf, const char *name, c_linker_sym_t *sym,
1516 elf_file_t ef = (elf_file_t) lf;
1567 link_elf_lookup_symbol(linker_file_t lf, const char *name, c_linker_sym_t *sym)
1570 return (link_elf_lookup_debug_symbol(lf, name, sym));
1571 return (link_elf_lookup_symbol1(lf, name, sym, false));
1575 link_elf_lookup_debug_symbol(linker_file_t lf, const char *name,
1578 elf_file_t ef = (elf_file_t)lf;
1583 if (link_elf_lookup_symbol1(lf, name, sym, true) == 0)
1604 link_elf_lookup_debug_symbol_ctf(linker_file_t lf, const char *name,
1607 elf_file_t ef = (elf_file_t)lf;
1628 return (i < ef->ddbsymcnt ? link_elf_ctf_get_ddb(lf, lc) : ENOENT);
1632 link_elf_symbol_values1(linker_file_t lf, c_linker_sym_t sym,
1639 ef = (elf_file_t)lf;
1656 link_elf_symbol_values(linker_file_t lf, c_linker_sym_t sym,
1660 return (link_elf_debug_symbol_values(lf, sym, symval));
1661 return (link_elf_symbol_values1(lf, sym, symval, false));
1665 link_elf_debug_symbol_values(linker_file_t lf, c_linker_sym_t sym,
1668 elf_file_t ef = (elf_file_t)lf;
1672 if (link_elf_symbol_values1(lf, sym, symval, true) == 0)
1690 link_elf_search_symbol(linker_file_t lf, caddr_t value,
1693 elf_file_t ef = (elf_file_t)lf;
1729 link_elf_lookup_set(linker_file_t lf, const char *name,
1743 error = link_elf_lookup_symbol(lf, setsym, &sym);
1746 link_elf_symbol_values(lf, sym, &symval);
1755 error = link_elf_lookup_symbol(lf, setsym, &sym);
1758 link_elf_symbol_values(lf, sym, &symval);
1828 elf_get_sym(linker_file_t lf, Elf_Size symidx)
1830 elf_file_t ef = (elf_file_t)lf;
1838 elf_get_symname(linker_file_t lf, Elf_Size symidx)
1840 elf_file_t ef = (elf_file_t)lf;
1857 elf_lookup(linker_file_t lf, Elf_Size symidx, int deps, Elf_Addr *res)
1859 elf_file_t ef = (elf_file_t)lf;
1901 addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps));
1918 link_elf_reloc_local(linker_file_t lf)
1924 elf_file_t ef = (elf_file_t)lf;
1930 elf_reloc_local(lf, (Elf_Addr)ef->address, rel,
1941 elf_reloc_local(lf, (Elf_Addr)ef->address, rela,
1949 link_elf_symtab_get(linker_file_t lf, const Elf_Sym **symtab)
1951 elf_file_t ef = (elf_file_t)lf;
1962 link_elf_strtab_get(linker_file_t lf, caddr_t *strtab)
1964 elf_file_t ef = (elf_file_t)lf;
1976 link_elf_propagate_vnets(linker_file_t lf)
1978 elf_file_t ef = (elf_file_t)lf;
1995 elf_lookup_ifunc(linker_file_t lf, Elf_Size symidx, int deps __unused,
2002 ef = (elf_file_t)lf;