| 597 | } |
| 598 | |
| 599 | linker_file_t |
| 600 | linker_make_file(const char *pathname, linker_class_t lc) |
| 601 | { |
| 602 | linker_file_t lf; |
| 603 | const char *filename; |
| 604 | |
| 605 | if (!cold) |
| 606 | sx_assert(&kld_sx, SA_XLOCKED); |
| 607 | filename = linker_basename(pathname); |
| 608 | |
| 609 | KLD_DPF(FILE, ("linker_make_file: new file, filename='%s' for pathname='%s'\n", filename, pathname)); |
| 610 | lf = (linker_file_t)kobj_create((kobj_class_t)lc, M_LINKER, M_WAITOK); |
| 611 | if (lf == NULL) |
| 612 | return (NULL); |
| 613 | lf->ctors_addr = 0; |
| 614 | lf->ctors_size = 0; |
| 615 | lf->refs = 1; |
| 616 | lf->userrefs = 0; |
| 617 | lf->flags = 0; |
| 618 | lf->filename = strdup(filename, M_LINKER); |
| 619 | lf->pathname = strdup(pathname, M_LINKER); |
| 620 | LINKER_GET_NEXT_FILE_ID(lf->id); |
| 621 | lf->ndeps = 0; |
| 622 | lf->deps = NULL; |
| 623 | lf->loadcnt = ++loadcnt; |
| 624 | #ifdef __arm__ |
| 625 | lf->exidx_addr = 0; |
| 626 | lf->exidx_size = 0; |
| 627 | #endif |
| 628 | STAILQ_INIT(&lf->common); |
| 629 | TAILQ_INIT(&lf->modules); |
| 630 | TAILQ_INSERT_TAIL(&linker_files, lf, link); |
| 631 | return (lf); |
| 632 | } |
| 633 | |
| 634 | int |
| 635 | linker_file_unload(linker_file_t file, int flags) |
no test coverage detected