Lines Matching defs:ofl

53 ifl_verify(Ehdr *ehdr, Ofl_desc *ofl, Rej_desc *rej)
71 if (ehdr->e_version > ofl->ofl_dehdr->e_version) {
84 ifl_setup(const char *name, Ehdr *ehdr, Elf *elf, Word flags, Ofl_desc *ofl,
90 if (ifl_verify(ehdr, ofl, &_rej) == 0) {
92 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
120 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
125 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
148 if (aplist_append(&ofl->ofl_sos, ifl, AL_CNT_OFL_LIBS) == NULL)
151 if (aplist_append(&ofl->ofl_objs, ifl, AL_CNT_OFL_OBJS) == NULL)
164 Word ndx, int ident, Ofl_desc *ofl)
183 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETDATA),
189 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
238 sf1_cap(Ofl_desc *ofl, Xword val, Ifl_desc *ifl, Is_desc *cisp)
248 if (ofl->ofl_flags1 & FLG_OF1_OVSFCAP1) {
249 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
262 ld_eprintf(ofl, ERR_WARNING,
281 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_BADSF1),
287 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_BADSF1),
308 if ((val & SF1_SUNW_ADDR32) && (ofl->ofl_flags & FLG_OF_EXEC) &&
309 ((ofl->ofl_ocapset.oc_sf_1.cm_val &
311 ld_eprintf(ofl, ERR_WARNING,
320 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_CURRENT, CA_SUNW_SF_1,
321 ofl->ofl_ocapset.oc_sf_1.cm_val, ld_targ.t_m.m_mach);
322 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_NEW, CA_SUNW_SF_1,
330 if ((ofl->ofl_ocapset.oc_sf_1.cm_val & FP_FLAGS) == FP_FLAGS) {
336 ofl->ofl_ocapset.oc_sf_1.cm_val &= ~SF1_SUNW_FPUSED;
344 } else if ((ofl->ofl_ocapset.oc_sf_1.cm_val & SF1_SUNW_FPKNWN) == 0) {
350 ofl->ofl_ocapset.oc_sf_1.cm_val &= ~FP_FLAGS;
356 ofl->ofl_ocapset.oc_sf_1.cm_val |= val;
358 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_RESOLVED,
359 CA_SUNW_SF_1, ofl->ofl_ocapset.oc_sf_1.cm_val, ld_targ.t_m.m_mach));
371 hw_cap(Ofl_desc *ofl, Xword tag, Xword val)
377 hwcap = &ofl->ofl_ocapset.oc_hw_1.cm_val;
380 hwcap = &ofl->ofl_ocapset.oc_hw_2.cm_val;
388 if (ofl->ofl_flags1 & flags1) {
389 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
402 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_CURRENT, CA_SUNW_HW_1,
403 ofl->ofl_ocapset.oc_hw_1.cm_val, ld_targ.t_m.m_mach);
404 Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_NEW, CA_SUNW_HW_1,
410 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml, DBG_STATE_RESOLVED, tag,
419 str_cap(Ofl_desc *ofl, char *pstr, ofl_flag_t flags, Xword tag, Caplist *list)
429 if (ofl->ofl_flags1 & flags) {
430 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_IGNORED,
436 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
442 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_NEW, tag, pstr));
447 ofl->ofl_flags |= FLG_OF_FATAL;
455 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
470 id_cap(Ofl_desc *ofl, char *pstr, oc_flag_t flags)
472 Objcapset *ocapset = &ofl->ofl_ocapset;
475 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_CURRENT,
480 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
486 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_NEW,
492 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml, DBG_STATE_RESOLVED,
505 ld_cap_move_symtoobj(Ofl_desc *ofl)
510 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx1, cgp)) {
517 id_cap(ofl, scapset->oc_id.cs_str,
523 str_cap(ofl, capstr->cs_str, FLG_OF1_OVPLATCAP,
524 CA_SUNW_PLAT, &ofl->ofl_ocapset.oc_plat);
530 str_cap(ofl, capstr->cs_str, FLG_OF1_OVMACHCAP,
531 CA_SUNW_MACH, &ofl->ofl_ocapset.oc_mach);
535 hw_cap(ofl, CA_SUNW_HW_2, scapset->oc_hw_2.cm_val);
538 hw_cap(ofl, CA_SUNW_HW_1, scapset->oc_hw_1.cm_val);
541 sf1_cap(ofl, scapset->oc_sf_1.cm_val, NULL, NULL);
554 get_cap_group(Objcapset *ocapset, Word cnum, Ofl_desc *ofl, Is_desc *isp)
570 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx, cgp)) {
618 (aplist_append(&(ofl->ofl_capgroups), cgp,
643 aplist_nitems(ofl->ofl_capgroups));
668 ofl->ofl_capsymcnt += (cnum + 1);
695 ld_cap_add_family(Ofl_desc *ofl, Sym_desc *lsdp, Sym_desc *csdp, Cap_group *cgp,
707 if ((avlt = ofl->ofl_capfamilies) == NULL) {
712 ofl->ofl_capfamilies = avlt;
719 ofl->ofl_capchaincnt = 1;
743 ofl->ofl_capchaincnt += 2;
775 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_CAP_MULDEF),
777 ld_eprintf(ofl, ERR_NONE, MSG_INTL(MSG_CAP_MULDEFSYMS),
796 ofl->ofl_capchaincnt++;
815 process_cap(Ofl_desc *ofl, Ifl_desc *ifl, Is_desc *cisp)
834 DBG_CALL(Dbg_cap_sec_title(ofl->ofl_lml, ifl->ifl_name));
893 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_UNKCAP),
907 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVSHINFO),
930 ((symcapndx != -1) || ((ofl->ofl_flags & FLG_OF_OTOSCAP) == 0))) {
946 sf1_cap(ofl, data->c_un.c_val, ifl, cisp);
961 hw_cap(ofl, data->c_tag, data->c_un.c_val);
965 str_cap(ofl, strs + data->c_un.c_ptr,
967 &ofl->ofl_ocapset.oc_plat);
971 str_cap(ofl, strs + data->c_un.c_ptr,
973 &ofl->ofl_ocapset.oc_mach);
977 id_cap(ofl, strs + data->c_un.c_ptr,
992 ((ofl->ofl_flags & FLG_OF_OTOSCAP) == 0))
1010 (symcapndx == -1) && (ofl->ofl_flags & FLG_OF_OTOSCAP))
1068 (ndx - descapndx), ofl,
1101 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1108 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1115 DBG_CALL(Dbg_cap_val_entry(ofl->ofl_lml,
1125 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1134 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1140 DBG_CALL(Dbg_cap_ptr_entry(ofl->ofl_lml,
1163 process_capinfo(Ofl_desc *ofl, Ifl_desc *ifl, Is_desc *isp)
1192 ld_eprintf(ofl, ERR_WARNING,
1201 ld_eprintf(ofl, ERR_WARNING,
1221 if (ld_cap_add_family(ofl, lsdp, sdp,
1234 ofl->ofl_caploclcnt++;
1235 if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) &&
1236 (st_insert(ofl->ofl_dynstrtab, sdp->sd_name) == -1))
1243 ofl->ofl_locscnt--;
1264 if (ld_cap_add_family(ofl, lsdp, sdp,
1281 Word ndx, int ident, Ofl_desc *ofl)
1284 ld_targ.t_id.id_null, ofl));
1296 Word ndx, int ident, Ofl_desc *ofl)
1299 shdr, scn, ndx, ld_targ.t_id.id_null, ofl) == S_ERROR)
1305 ofl->ofl_relocincnt +=
1307 } else if (ofl->ofl_flags & FLG_OF_EXEC) {
1321 Word ndx, int ident, Ofl_desc *ofl)
1332 if (((ofl->ofl_flags & FLG_OF_STRIP) && ident &&
1346 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1360 ld_eprintf(ofl, ERR_WARNING,
1376 Word ndx, int ident, Ofl_desc *ofl)
1380 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_INVALSEC),
1423 * name, ifl, shdr, ndx, ident, ofl - As passed to process_progbits().
1435 Word ndx, int *ident, Ofl_desc *ofl, Boolean is_stab_index,
1529 Word ndx, int ident, Ofl_desc *ofl)
1541 if ((ofl->ofl_flags & FLG_OF_STRIP) ||
1551 if ((ofl->ofl_flags & FLG_OF_STRIP) && ident) {
1578 &ident, ofl, is_stab_index, &is_flags) == FALSE)
1585 r = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1602 Word ndx, int ident, Ofl_desc *ofl)
1607 if (ofl->ofl_flags & FLG_OF_STRIP) {
1610 return (process_progbits(name, ifl, shdr, scn, ndx, ident, ofl));
1618 Word ndx, int ident, Ofl_desc *ofl)
1631 return (process_section(name, ifl, shdr, scn, ndx, ident, ofl));
1639 Word ndx, int ident, Ofl_desc *ofl)
1646 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
1655 array_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
1666 (ofl->ofl_osfiniarray == NULL))
1667 ofl->ofl_osfiniarray = osp;
1669 (ofl->ofl_osinitarray == NULL))
1670 ofl->ofl_osinitarray = osp;
1672 (ofl->ofl_ospreinitarray == NULL))
1673 ofl->ofl_ospreinitarray = osp;
1683 Word ndx, int ident, Ofl_desc *ofl)
1685 if (process_input(name, ifl, shdr, scn, ndx, ident, ofl) == S_ERROR)
1696 ld_eprintf(ofl, ERR_FATAL,
1711 sym_shndx_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
1718 ld_eprintf(ofl, ERR_FATAL,
1739 Word ndx, int ident, Ofl_desc *ofl)
1749 if ((ofl->ofl_flags1 & FLG_OF1_RELDYN) == 0)
1756 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
1776 (aplist_append(&ofl->ofl_sos, difl,
1786 if ((ofl->ofl_rpath = add_string(ofl->ofl_rpath,
2082 Elf_Scn *scn, Word ndx, int ident, Ofl_desc *ofl)
2088 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
2117 process_dynamic(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2128 no_undef = (ofl->ofl_flags & (FLG_OF_NOUNDEF | FLG_OF_SYMBOLIC)) ||
2129 OFL_GUIDANCE(ofl, FLG_OFG_NO_DEFS);
2175 if ((sdf = sdf_find(needed, ofl->ofl_soneed)) == NULL) {
2177 &ofl->ofl_soneed)) == (Sdf_desc *)S_ERROR)
2213 (ofl->ofl_flags & FLG_OF_EXEC))
2221 if ((ofl->ofl_depaudit = add_string(ofl->ofl_depaudit,
2262 for (APLIST_TRAVERSE(ofl->ofl_sos, idx, sifl)) {
2291 ld_eprintf(ofl, ERR_FATAL,
2303 if (ofl->ofl_soname &&
2304 (strcmp(ofl->ofl_soname, ifl->ifl_soname) == 0)) {
2305 ld_eprintf(ofl, ERR_FATAL,
2320 process_progbits_final(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2323 (ld_unwind_register(isc->is_osdesc, ofl) == S_ERROR))
2334 Word ndx, int ident, Ofl_desc *ofl)
2338 error = process_section(name, ifl, shdr, scn, ndx, ident, ofl);
2357 rel_process(Is_desc *isc, Ifl_desc *ifl, Ofl_desc *ofl)
2369 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVALSEC),
2388 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_INVSHINFO),
2394 if (aplist_append(&ofl->ofl_extrarels, isc,
2412 if (aplist_append(&ofl->ofl_ismoverel,
2417 ld_eprintf(ofl, ERR_FATAL,
2435 Word ndx, Ofl_desc *ofl)
2453 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_FIL_EXCLUDE),
2461 return (process_section(name, ifl, shdr, scn, ndx, 0, ofl));
2531 process_elf(Ifl_desc *ifl, Elf *elf, Ofl_desc *ofl)
2550 path_info = ld_place_path_info_init(ofl, ifl, &path_info_buf);
2556 ld_sup_file(ofl, ifl->ifl_name, elf_kind(elf), ifl->ifl_flags, elf);
2560 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSCN),
2565 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
2571 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_STRPTR),
2576 if (ld_sup_input_section(ofl, ifl, name, &shdr, sndx, scn,
2586 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_STRPTR),
2591 error = process_strtab(name, ifl, shdr, scn, sndx, FALSE, ofl);
2602 ofl->ofl_soscnt++;
2606 ofl->ofl_objscnt++;
2610 DBG_CALL(Dbg_file_generic(ofl->ofl_lml, ifl));
2624 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_GETSHDR),
2630 if (ld_sup_input_section(ofl, ifl, name, &shdr, ndx, scn,
2647 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
2649 ndx, ofl)) == S_ERROR)
2662 ndx, ident, ofl) == S_ERROR)
2674 ld_eprintf(ofl, ERR_WARNING,
2688 ndx, ident, ofl) == S_ERROR)
2693 ld_targ.t_id.id_null, ofl) == S_ERROR)
2699 ld_targ.t_id.id_null, ofl) == S_ERROR)
2706 ndx, ident, ofl) == S_ERROR)
2711 ld_targ.t_id.id_null, ofl) == S_ERROR)
2716 ld_targ.t_id.id_null, ofl) == S_ERROR)
2722 ndx, ident, ofl) == S_ERROR)
2727 ndx, ident, ofl) == S_ERROR)
2733 ld_targ.t_id.id_null, ofl) == S_ERROR)
2739 ld_targ.t_id.id_null, ofl) == S_ERROR)
2745 ld_targ.t_id.id_null, ofl) == S_ERROR)
2760 ld_targ.t_id.id_gotdata, ofl) == S_ERROR)
2784 ofl) == S_ERROR)
2795 ident : ld_targ.t_id.id_user), ofl) ==
2818 if (ld_group_process(isp, ofl) == S_ERROR)
2829 ld_comdat_validate(ofl, ifl);
2847 if (ld_place_section(ofl, isp, path_info,
2878 if (ld_process_ordered(ofl, ifl, path_info, ndx) ==
2909 if ((sdf = sdf_find(base, ofl->ofl_socntl)) != NULL) {
2922 if (capisp && (process_cap(ofl, ifl, capisp) == S_ERROR))
2930 if (vndisp && ((ofl->ofl_flags & (FLG_OF_NOUNDEF | FLG_OF_SYMBOLIC)) ||
2931 OFL_GUIDANCE(ofl, FLG_OFG_NO_DEFS)))
2932 if (ld_vers_need_process(vndisp, ifl, ofl) == S_ERROR)
2940 (void) ld_vers_sym_process(ofl, vsyisp, ifl);
2944 if (ld_vers_def_process(vdfisp, ifl, ofl) == S_ERROR)
2959 ld_sup_section(ofl, isp->is_name, isp->is_shdr, ndx,
2967 if (aplist_append(&(ofl->ofl_ismove), isp,
2979 ofl) == S_ERROR)
2995 (ld_unwind_register(osp, ofl) == S_ERROR))
3008 (process_capinfo(ofl, ifl, capinfoisp) == S_ERROR))
3018 (void) ld_sym_nodirect(sifisp, ifl, ofl);
3050 * ofl - Output file descriptor
3065 Word flags, Ofl_desc *ofl, Rej_desc *rej, Ifl_desc **ifl_ret)
3098 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3113 for (APLIST_TRAVERSE(ofl->ofl_ars, idx, adp)) {
3125 DBG_CALL(Dbg_file_reuse(ofl->ofl_lml, name,
3128 if (!ld_process_archive(name, -1, adp, ofl))
3138 adp = ld_ar_setup(name, elf, ofl);
3144 ld_sup_file(ofl, name, ELF_K_AR, flags, elf);
3159 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_CNTL),
3164 if (!ld_process_archive(name, -1, adp, ofl))
3191 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3208 apl = ofl->ofl_objs;
3210 apl = ofl->ofl_sos;
3231 DBG_CALL(Dbg_file_skip(ofl->ofl_lml,
3257 ld_eprintf(ofl, ERR_WARNING,
3270 ifl = ifl_setup(name, ehdr, elf, flags, ofl, rej);
3281 if (ofl->ofl_flags1 & FLG_OF1_IGNORE)
3286 (*ld_targ.t_mr.mr_mach_eflags)(ehdr, ofl);
3287 error = process_elf(ifl, elf, ofl);
3290 if ((ofl->ofl_flags & FLG_OF_STATIC) ||
3291 !(ofl->ofl_flags & FLG_OF_DYNLIBS)) {
3292 ld_eprintf(ofl, ERR_FATAL,
3315 if (ofl->ofl_flags1 & FLG_OF1_ZDIRECT)
3317 if (ofl->ofl_flags1 & FLG_OF1_LAZYLD)
3319 if (ofl->ofl_flags1 & FLG_OF1_GRPPRM)
3321 if (ofl->ofl_flags1 & FLG_OF1_DEFERRED)
3325 error = process_elf(ifl, elf, ofl);
3331 ofl->ofl_flags |= FLG_OF_SYMINFO;
3338 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_LAZY) &&
3340 ld_eprintf(ofl, ERR_GUIDANCE,
3342 ofl->ofl_guideflags |= FLG_OFG_NO_LAZY;
3349 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_DB)) {
3350 ld_eprintf(ofl, ERR_GUIDANCE,
3352 ofl->ofl_guideflags |= FLG_OFG_NO_DB;
3360 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3373 DBG_CALL(Dbg_file_rejected(ofl->ofl_lml, &_rej,
3396 ld_process_open(const char *opath, const char *ofile, int *fd, Ofl_desc *ofl,
3404 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_BEGIN), npath);
3421 ld_sup_open(ofl, &npath, &nfile, fd, flags, &elf, NULL, 0,
3427 return (ld_process_ifl(npath, nfile, *fd, elf, flags, ofl, rej,
3438 Ofl_desc *ofl, Rej_desc *rej)
3445 ld_eprintf(ofl, ERR_ELF, MSG_INTL(MSG_ELF_MEMORY), path);
3449 open_ret = ld_process_ifl(path, file, 0, elf, 0, ofl, rej, &ifl);
3462 Ofl_desc *ofl, Rej_desc *rej)
3480 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_FIL_PTHTOLONG),
3491 DBG_CALL(Dbg_libs_req(ofl->ofl_lml, sdf->sdf_name,
3504 open_ret = ld_process_open(_path, &_path[dlen], &fd, ofl,
3527 ld_finish_libs(Ofl_desc *ofl)
3536 ofl->ofl_flags |= FLG_OF_DYNLIBS;
3538 for (APLIST_TRAVERSE(ofl->ofl_soneed, idx1, sdf)) {
3555 for (APLIST_TRAVERSE(ofl->ofl_sos, idx2, ifl)) {
3575 DBG_CALL(Dbg_libs_req(ofl->ofl_lml, sdf->sdf_name,
3578 ld_eprintf(ofl, ERR_WARNING,
3586 &fd, ofl, 0, &_rej, &ifl);
3595 ld_eprintf(ofl, ERR_WARNING,
3610 for (APLIST_TRAVERSE(ofl->ofl_ulibdirs, idx2, path)) {
3613 ifl = process_req_lib(sdf, path, file, ofl, &_rej);
3642 DBG_CALL(Dbg_libs_path(ofl->ofl_lml, rpath,
3653 file, ofl, &_rej);
3677 for (APLIST_TRAVERSE(ofl->ofl_dlibdirs, idx2, path)) {
3680 ifl = process_req_lib(sdf, path, file, ofl, &rej);
3707 ld_eprintf(ofl, ERR_WARNING,
3714 ld_eprintf(ofl, ERR_WARNING,
3723 return (ld_vers_verify(ofl));