Lines Matching refs:ofl

52 ifl_verify(Ehdr *ehdr, Ofl_desc *ofl, Rej_desc *rej)
70 if (ehdr->e_version > ofl->ofl_dehdr->e_version) {
83 ifl_setup(const char *name, Ehdr *ehdr, Elf *elf, Word flags, Ofl_desc *ofl,
89 if (ifl_verify(ehdr, ofl, &_rej) == 0) {
91 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
119 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
124 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
147 if (aplist_append(&ofl->ofl_sos, ifl, AL_CNT_OFL_LIBS) == NULL)
150 if (aplist_append(&ofl->ofl_objs, ifl, AL_CNT_OFL_OBJS) == NULL)
163 Word ndx, int ident, Ofl_desc *ofl)
182 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETDATA),
188 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
237 sf1_cap(Ofl_desc *ofl, Xword val, Ifl_desc *ifl, Is_desc *cisp)
247 if (ofl->ofl_flags1 & FLG_OF1_OVSFCAP1) {
248 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
261 ld_eprintf(ofl, ERR_WARNING,
280 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_BADSF1),
286 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_BADSF1),
307 if ((val & SF1_SUNW_ADDR32) && (ofl->ofl_flags & FLG_OF_EXEC) &&
308 ((ofl->ofl_ocapset.oc_sf_1.cm_val &
310 ld_eprintf(ofl, ERR_WARNING,
319 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_CURRENT, CA_SUNW_SF_1,
320 ofl->ofl_ocapset.oc_sf_1.cm_val, ld_targ.t_m.m_mach);
321 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_NEW, CA_SUNW_SF_1,
329 if ((ofl->ofl_ocapset.oc_sf_1.cm_val & FP_FLAGS) == FP_FLAGS) {
335 ofl->ofl_ocapset.oc_sf_1.cm_val &= ~SF1_SUNW_FPUSED;
343 } else if ((ofl->ofl_ocapset.oc_sf_1.cm_val & SF1_SUNW_FPKNWN) == 0) {
349 ofl->ofl_ocapset.oc_sf_1.cm_val &= ~FP_FLAGS;
355 ofl->ofl_ocapset.oc_sf_1.cm_val |= val;
357 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_RESOLVED,
358 CA_SUNW_SF_1, ofl->ofl_ocapset.oc_sf_1.cm_val, ld_targ.t_m.m_mach));
370 hw_cap(Ofl_desc *ofl, Xword tag, Xword val)
376 hwcap = &ofl->ofl_ocapset.oc_hw_1.cm_val;
379 hwcap = &ofl->ofl_ocapset.oc_hw_2.cm_val;
387 if (ofl->ofl_flags1 & flags1) {
388 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
401 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_CURRENT, CA_SUNW_HW_1,
402 ofl->ofl_ocapset.oc_hw_1.cm_val, ld_targ.t_m.m_mach);
403 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_NEW, CA_SUNW_HW_1,
409 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_RESOLVED, tag,
418 str_cap(Ofl_desc *ofl, char *pstr, ofl_flag_t flags, Xword tag, Caplist *list)
428 if (ofl->ofl_flags1 & flags) {
429 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
435 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
441 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_NEW, tag, pstr));
446 ofl->ofl_flags |= FLG_OF_FATAL;
454 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
469 id_cap(Ofl_desc *ofl, char *pstr, oc_flag_t flags)
471 Objcapset *ocapset = &ofl->ofl_ocapset;
474 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_CURRENT,
479 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
485 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_NEW,
491 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_RESOLVED,
504 ld_cap_move_symtoobj(Ofl_desc *ofl)
509 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx1, cgp)) {
516 id_cap(ofl, scapset->oc_id.cs_str,
522 str_cap(ofl, capstr->cs_str, FLG_OF1_OVPLATCAP,
523 CA_SUNW_PLAT, &ofl->ofl_ocapset.oc_plat);
529 str_cap(ofl, capstr->cs_str, FLG_OF1_OVMACHCAP,
530 CA_SUNW_MACH, &ofl->ofl_ocapset.oc_mach);
534 hw_cap(ofl, CA_SUNW_HW_2, scapset->oc_hw_2.cm_val);
537 hw_cap(ofl, CA_SUNW_HW_1, scapset->oc_hw_1.cm_val);
540 sf1_cap(ofl, scapset->oc_sf_1.cm_val, NULL, NULL);
553 get_cap_group(Objcapset *ocapset, Word cnum, Ofl_desc *ofl, Is_desc *isp)
569 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx, cgp)) {
617 (aplist_append(&(ofl->ofl_capgroups), cgp,
642 aplist_nitems(ofl->ofl_capgroups));
667 ofl->ofl_capsymcnt += (cnum + 1);
694 ld_cap_add_family(Ofl_desc *ofl, Sym_desc *lsdp, Sym_desc *csdp, Cap_group *cgp,
706 if ((avlt = ofl->ofl_capfamilies) == NULL) {
711 ofl->ofl_capfamilies = avlt;
718 ofl->ofl_capchaincnt = 1;
742 ofl->ofl_capchaincnt += 2;
774 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_CAP_MULDEF),
776 ld_eprintf(ofl, ERR_NONE, MSG_INTL(MSG_CAP_MULDEFSYMS),
795 ofl->ofl_capchaincnt++;
814 process_cap(Ofl_desc *ofl, Ifl_desc *ifl, Is_desc *cisp)
833 DBG_CALL(Dbg_cap_sec_title(ofl->ofl_lml, ifl->ifl_name));
892 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_UNKCAP),
906 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVSHINFO),
929 ((symcapndx != -1) || ((ofl->ofl_flags & FLG_OF_OTOSCAP) == 0))) {
945 sf1_cap(ofl, data->c_un.c_val, ifl, cisp);
960 hw_cap(ofl, data->c_tag, data->c_un.c_val);
964 str_cap(ofl, strs + data->c_un.c_ptr,
966 &ofl->ofl_ocapset.oc_plat);
970 str_cap(ofl, strs + data->c_un.c_ptr,
972 &ofl->ofl_ocapset.oc_mach);
976 id_cap(ofl, strs + data->c_un.c_ptr,
991 ((ofl->ofl_flags & FLG_OF_OTOSCAP) == 0))
1009 (symcapndx == -1) && (ofl->ofl_flags & FLG_OF_OTOSCAP))
1067 (ndx - descapndx), ofl,
1100 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1107 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1114 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1124 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1133 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1139 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1162 process_capinfo(Ofl_desc *ofl, Ifl_desc *ifl, Is_desc *isp)
1191 ld_eprintf(ofl, ERR_WARNING,
1200 ld_eprintf(ofl, ERR_WARNING,
1220 if (ld_cap_add_family(ofl, lsdp, sdp,
1233 ofl->ofl_caploclcnt++;
1234 if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
1235 (st_insert(ofl->ofl_dynstrtab, sdp->sd_name) == -1))
1242 ofl->ofl_locscnt--;
1263 if (ld_cap_add_family(ofl, lsdp, sdp,
1280 Word ndx, int ident, Ofl_desc *ofl)
1283 ld_targ.t_id.id_null, ofl));
1295 Word ndx, int ident, Ofl_desc *ofl)
1298 shdr, scn, ndx, ld_targ.t_id.id_null, ofl) == S_ERROR)
1304 ofl->ofl_relocincnt +=
1306 } else if (ofl->ofl_flags & FLG_OF_EXEC) {
1320 Word ndx, int ident, Ofl_desc *ofl)
1331 if (((ofl->ofl_flags & FLG_OF_STRIP) && ident &&
1345 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1359 ld_eprintf(ofl, ERR_WARNING,
1375 Word ndx, int ident, Ofl_desc *ofl)
1379 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_INVALSEC),
1422 * name, ifl, shdr, ndx, ident, ofl - As passed to process_progbits().
1433 Word ndx, int *ident, Ofl_desc *ofl, Boolean is_stab_index,
1457 ld_eprintf(ofl, ERR_FATAL,
1518 Word ndx, int ident, Ofl_desc *ofl)
1530 if ((ofl->ofl_flags & FLG_OF_STRIP) ||
1540 if ((ofl->ofl_flags & FLG_OF_STRIP) && ident) {
1567 &ident, ofl, is_stab_index, &is_flags) == FALSE)
1574 r = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1591 Word ndx, int ident, Ofl_desc *ofl)
1596 if (ofl->ofl_flags & FLG_OF_STRIP) {
1599 return (process_progbits(name, ifl, shdr, scn, ndx, ident, ofl));
1607 Word ndx, int ident, Ofl_desc *ofl)
1620 return (process_section(name, ifl, shdr, scn, ndx, ident, ofl));
1628 Word ndx, int ident, Ofl_desc *ofl)
1635 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1644 array_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
1655 (ofl->ofl_osfiniarray == NULL))
1656 ofl->ofl_osfiniarray = osp;
1658 (ofl->ofl_osinitarray == NULL))
1659 ofl->ofl_osinitarray = osp;
1661 (ofl->ofl_ospreinitarray == NULL))
1662 ofl->ofl_ospreinitarray = osp;
1672 Word ndx, int ident, Ofl_desc *ofl)
1674 if (process_input(name, ifl, shdr, scn, ndx, ident, ofl) == S_ERROR)
1685 ld_eprintf(ofl, ERR_FATAL,
1700 sym_shndx_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
1707 ld_eprintf(ofl, ERR_FATAL,
1728 Word ndx, int ident, Ofl_desc *ofl)
1738 if ((ofl->ofl_flags1 & FLG_OF1_RELDYN) == 0)
1745 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
1765 (aplist_append(&ofl->ofl_sos, difl,
1775 if ((ofl->ofl_rpath = add_string(ofl->ofl_rpath,
2071 Elf_Scn *scn, Word ndx, int ident, Ofl_desc *ofl)
2077 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
2106 process_dynamic(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2117 no_undef = (ofl->ofl_flags & (FLG_OF_NOUNDEF | FLG_OF_SYMBOLIC)) ||
2118 OFL_GUIDANCE(ofl, FLG_OFG_NO_DEFS);
2164 if ((sdf = sdf_find(needed, ofl->ofl_soneed)) == NULL) {
2166 &ofl->ofl_soneed)) == (Sdf_desc *)S_ERROR)
2202 (ofl->ofl_flags & FLG_OF_EXEC))
2210 if ((ofl->ofl_depaudit = add_string(ofl->ofl_depaudit,
2251 for (APLIST_TRAVERSE(ofl->ofl_sos, idx, sifl)) {
2280 ld_eprintf(ofl, ERR_FATAL,
2292 if (ofl->ofl_soname &&
2293 (strcmp(ofl->ofl_soname, ifl->ifl_soname) == 0)) {
2294 ld_eprintf(ofl, ERR_FATAL,
2309 process_progbits_final(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2312 (ld_unwind_register(isc->is_osdesc, ofl) == S_ERROR))
2323 Word ndx, int ident, Ofl_desc *ofl)
2327 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
2346 rel_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2358 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVALSEC),
2377 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVSHINFO),
2383 if (aplist_append(&ofl->ofl_extrarels, isc,
2401 if (aplist_append(&ofl->ofl_ismoverel,
2406 ld_eprintf(ofl, ERR_FATAL,
2424 Word ndx, Ofl_desc *ofl)
2442 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_EXCLUDE),
2450 return (process_section(name, ifl, shdr, scn, ndx, 0, ofl));
2520 process_elf(Ifl_desc *ifl, Elf *elf, Ofl_desc *ofl)
2539 path_info = ld_place_path_info_init(ofl, ifl, &path_info_buf);
2545 ld_sup_file(ofl, ifl->ifl_name, elf_kind(elf), ifl->ifl_flags, elf);
2549 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
2554 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
2560 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_STRPTR),
2565 if (ld_sup_input_section(ofl, ifl, name, &shdr, sndx, scn,
2575 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_STRPTR),
2580 error = process_strtab(name, ifl, shdr, scn, sndx, FALSE, ofl);
2591 ofl->ofl_soscnt++;
2595 ofl->ofl_objscnt++;
2599 DBG_CALL(Dbg_file_generic(ofl->ofl_lml, ifl));
2613 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
2619 if (ld_sup_input_section(ofl, ifl, name, &shdr, ndx, scn,
2636 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
2638 ndx, ofl)) == S_ERROR)
2651 ndx, ident, ofl) == S_ERROR)
2663 ld_eprintf(ofl, ERR_WARNING,
2677 ndx, ident, ofl) == S_ERROR)
2682 ld_targ.t_id.id_null, ofl) == S_ERROR)
2688 ld_targ.t_id.id_null, ofl) == S_ERROR)
2695 ndx, ident, ofl) == S_ERROR)
2700 ld_targ.t_id.id_null, ofl) == S_ERROR)
2705 ld_targ.t_id.id_null, ofl) == S_ERROR)
2711 ndx, ident, ofl) == S_ERROR)
2716 ndx, ident, ofl) == S_ERROR)
2722 ld_targ.t_id.id_null, ofl) == S_ERROR)
2728 ld_targ.t_id.id_null, ofl) == S_ERROR)
2734 ld_targ.t_id.id_null, ofl) == S_ERROR)
2749 ld_targ.t_id.id_gotdata, ofl) == S_ERROR)
2773 ofl) == S_ERROR)
2784 ident : ld_targ.t_id.id_user), ofl) ==
2807 if (ld_group_process(isp, ofl) == S_ERROR)
2828 if (ld_place_section(ofl, isp, path_info,
2859 if (ld_process_ordered(ofl, ifl, path_info, ndx) ==
2890 if ((sdf = sdf_find(base, ofl->ofl_socntl)) != NULL) {
2903 if (capisp && (process_cap(ofl, ifl, capisp) == S_ERROR))
2911 if (vndisp && ((ofl->ofl_flags & (FLG_OF_NOUNDEF | FLG_OF_SYMBOLIC)) ||
2912 OFL_GUIDANCE(ofl, FLG_OFG_NO_DEFS)))
2913 if (ld_vers_need_process(vndisp, ifl, ofl) == S_ERROR)
2921 (void) ld_vers_sym_process(ofl, vsyisp, ifl);
2925 if (ld_vers_def_process(vdfisp, ifl, ofl) == S_ERROR)
2940 ld_sup_section(ofl, isp->is_name, isp->is_shdr, ndx,
2948 if (aplist_append(&(ofl->ofl_ismove), isp,
2960 ofl) == S_ERROR)
2976 (ld_unwind_register(osp, ofl) == S_ERROR))
2989 (process_capinfo(ofl, ifl, capinfoisp) == S_ERROR))
2999 (void) ld_sym_nodirect(sifisp, ifl, ofl);
3031 * ofl - Output file descriptor
3046 Word flags, Ofl_desc *ofl, Rej_desc *rej, Ifl_desc **ifl_ret)
3079 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3094 for (APLIST_TRAVERSE(ofl->ofl_ars, idx, adp)) {
3106 DBG_CALL(Dbg_file_reuse(ofl->ofl_lml, name,
3109 if (!ld_process_archive(name, -1, adp, ofl))
3119 adp = ld_ar_setup(name, elf, ofl);
3125 ld_sup_file(ofl, name, ELF_K_AR, flags, elf);
3140 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_CNTL),
3145 if (!ld_process_archive(name, -1, adp, ofl))
3172 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3189 apl = ofl->ofl_objs;
3191 apl = ofl->ofl_sos;
3212 DBG_CALL(Dbg_file_skip(ofl->ofl_lml,
3238 ld_eprintf(ofl, ERR_WARNING,
3251 ifl = ifl_setup(name, ehdr, elf, flags, ofl, rej);
3262 if (ofl->ofl_flags1 & FLG_OF1_IGNORE)
3267 (*ld_targ.t_mr.mr_mach_eflags)(ehdr, ofl);
3268 error = process_elf(ifl, elf, ofl);
3271 if ((ofl->ofl_flags & FLG_OF_STATIC) ||
3272 !(ofl->ofl_flags & FLG_OF_DYNLIBS)) {
3273 ld_eprintf(ofl, ERR_FATAL,
3296 if (ofl->ofl_flags1 & FLG_OF1_ZDIRECT)
3298 if (ofl->ofl_flags1 & FLG_OF1_LAZYLD)
3300 if (ofl->ofl_flags1 & FLG_OF1_GRPPRM)
3302 if (ofl->ofl_flags1 & FLG_OF1_DEFERRED)
3306 error = process_elf(ifl, elf, ofl);
3312 ofl->ofl_flags |= FLG_OF_SYMINFO;
3319 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_LAZY) &&
3321 ld_eprintf(ofl, ERR_GUIDANCE,
3323 ofl->ofl_guideflags |= FLG_OFG_NO_LAZY;
3330 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_DB)) {
3331 ld_eprintf(ofl, ERR_GUIDANCE,
3333 ofl->ofl_guideflags |= FLG_OFG_NO_DB;
3341 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3354 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3377 ld_process_open(const char *opath, const char *ofile, int *fd, Ofl_desc *ofl,
3385 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_BEGIN), npath);
3402 ld_sup_open(ofl, &npath, &nfile, fd, flags, &elf, NULL, 0,
3408 return (ld_process_ifl(npath, nfile, *fd, elf, flags, ofl, rej,
3419 Ofl_desc *ofl, Rej_desc *rej)
3426 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_MEMORY), path);
3430 open_ret = ld_process_ifl(path, file, 0, elf, 0, ofl, rej, &ifl);
3443 Ofl_desc *ofl, Rej_desc *rej)
3461 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_PTHTOLONG),
3472 DBG_CALL(Dbg_libs_req(ofl->ofl_lml, sdf->sdf_name,
3485 open_ret = ld_process_open(_path, &_path[dlen], &fd, ofl,
3508 ld_finish_libs(Ofl_desc *ofl)
3517 ofl->ofl_flags |= FLG_OF_DYNLIBS;
3519 for (APLIST_TRAVERSE(ofl->ofl_soneed, idx1, sdf)) {
3536 for (APLIST_TRAVERSE(ofl->ofl_sos, idx2, ifl)) {
3556 DBG_CALL(Dbg_libs_req(ofl->ofl_lml, sdf->sdf_name,
3559 ld_eprintf(ofl, ERR_WARNING,
3567 &fd, ofl, 0, &_rej, &ifl);
3576 ld_eprintf(ofl, ERR_WARNING,
3591 for (APLIST_TRAVERSE(ofl->ofl_ulibdirs, idx2, path)) {
3594 ifl = process_req_lib(sdf, path, file, ofl, &_rej);
3623 DBG_CALL(Dbg_libs_path(ofl->ofl_lml, rpath,
3634 file, ofl, &_rej);
3658 for (APLIST_TRAVERSE(ofl->ofl_dlibdirs, idx2, path)) {
3661 ifl = process_req_lib(sdf, path, file, ofl, &rej);
3688 ld_eprintf(ofl, ERR_WARNING,
3695 ld_eprintf(ofl, ERR_WARNING,
3704 return (ld_vers_verify(ofl));