Lines Matching defs:ofl
44 remove_local(Ofl_desc *ofl, Sym_desc *sdp, int allow_ldynsym)
51 if ((ofl->ofl_flags & FLG_OF_REDLSYM) == 0) {
52 ofl->ofl_locscnt--;
54 err = st_delstring(ofl->ofl_strtab, sdp->sd_name);
58 ofl->ofl_dynlocscnt--;
60 err = st_delstring(ofl->ofl_dynstrtab, sdp->sd_name);
70 remove_scoped(Ofl_desc *ofl, Sym_desc *sdp, int allow_ldynsym)
77 ofl->ofl_scopecnt--;
78 ofl->ofl_elimcnt++;
80 err = st_delstring(ofl->ofl_strtab, sdp->sd_name);
84 ofl->ofl_dynscopecnt--;
86 err = st_delstring(ofl->ofl_dynstrtab, sdp->sd_name);
95 ignore_sym(Ofl_desc *ofl, Ifl_desc *ifl, Sym_desc *sdp, int allow_ldynsym)
120 DBG_CALL(Dbg_syms_discarded(ofl->ofl_lml, sdp));
122 remove_local(ofl, sdp, allow_ldynsym);
139 DBG_CALL(Dbg_syms_discarded(ofl->ofl_lml, sdp));
141 remove_scoped(ofl, sdp, allow_ldynsym);
153 DBG_CALL(Dbg_syms_discarded(ofl->ofl_lml, sdp));
156 remove_local(ofl, sdp, allow_ldynsym);
158 remove_scoped(ofl, sdp, allow_ldynsym);
197 * ofl->ofl_shdrcnt and remove the section name from the .shstrtab string
198 * table (ofl->ofl_shdrsttab).
204 adjust_os_count(Ofl_desc *ofl)
211 if ((ofl->ofl_flags & FLG_OF_ADJOSCNT) == 0)
219 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
244 ofl->ofl_shdrcnt--;
245 err = st_delstring(ofl->ofl_shdrsttab,
271 ignore_section_processing(Ofl_desc *ofl)
279 int allow_ldynsym = OFL_ALLOW_LDYNSYM(ofl);
282 for (APLIST_TRAVERSE(ofl->ofl_objs, idx1, ifl)) {
289 DBG_CALL(Dbg_unused_file(ofl->ofl_lml,
291 if (((ofl->ofl_flags1 & FLG_OF1_IGNPRC) == 0) ||
342 ignore_sym(ofl, ifl, sdp, allow_ldynsym);
349 if ((ofl->ofl_flags1 & FLG_OF1_IGNPRC) == 0)
356 REL_CACHE_TRAVERSE(&ofl->ofl_outrels, idx1, rcbp, rsp) {
385 ofl->ofl_reloccntsub++;
388 ofl->ofl_relocrelcnt--;
395 ofl->ofl_flags |= FLG_OF_ADJOSCNT;
405 * ofl - Output file descriptor
426 new_section(Ofl_desc *ofl, Word shtype, const char *shname, Xword entcnt,
489 ofl->ofl_flags |= FLG_OF_OSABI;
527 ofl->ofl_flags |= FLG_OF_OSABI;
569 ofl->ofl_flags |= FLG_OF_OSABI;
574 ofl->ofl_flags |= FLG_OF_OSABI;
580 ofl->ofl_flags |= FLG_OF_OSABI;
591 ofl->ofl_flags |= FLG_OF_OSABI;
597 ofl->ofl_flags |= FLG_OF_OSABI;
609 ofl->ofl_flags |= FLG_OF_OSABI;
619 ofl->ofl_flags |= FLG_OF_OSABI;
642 data->d_version = ofl->ofl_dehdr->e_version;
677 * ofl - Output file descriptor
691 new_section_from_template(Ofl_desc *ofl, Is_desc *tmpl_isp, size_t size,
706 data->d_version = ofl->ofl_dehdr->e_version;
743 ld_make_bss(Ofl_desc *ofl, Xword size, Xword align, uint_t ident)
749 Xword rsize = (Xword)ofl->ofl_relocbsssz;
756 if (new_section(ofl, SHT_NOBITS, NULL, 0,
768 ofl->ofl_istlsbss = isec;
773 ofl->ofl_isbss = isec;
779 ofl->ofl_islbss = isec;
788 if ((osp = ld_place_section(ofl, isec, NULL, ident, NULL)) ==
804 if (ofl->ofl_flags1 & flagtotest) {
805 ofl->ofl_dynshdrcnt++;
819 make_array(Ofl_desc *ofl, Word shtype, const char *sectname, APlist *alp)
839 if (new_section(ofl, shtype, sectname, entcount, &isec, &shdr, &data) ==
846 if (ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_array, NULL) ==
852 if ((ofl->ofl_osinitarray == NULL) && (shtype == SHT_INIT_ARRAY))
853 ofl->ofl_osinitarray = osp;
854 if ((ofl->ofl_ospreinitarray == NULL) && (shtype == SHT_PREINIT_ARRAY))
855 ofl->ofl_ospreinitarray = osp;
856 else if ((ofl->ofl_osfiniarray == NULL) && (shtype == SHT_FINI_ARRAY))
857 ofl->ofl_osfiniarray = osp;
883 DBG_CALL(Dbg_reloc_generate(ofl->ofl_lml, osp,
888 if (ld_process_sym_reloc(ofl, &reld, (Rel *)&reloc, isec,
905 make_comment(Ofl_desc *ofl)
911 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_COMMENT), 0,
915 data->d_buf = (void *)ofl->ofl_sgsid;
916 data->d_size = strlen(ofl->ofl_sgsid) + 1;
923 return ((uintptr_t)ld_place_section(ofl, isec, NULL,
936 make_dynamic(Ofl_desc *ofl)
948 ofl_flag_t flags = ofl->ofl_flags;
955 if (OFL_IS_STATIC_OBJ(ofl))
956 strtbl = ofl->ofl_strtab;
958 strtbl = ofl->ofl_dynstrtab;
965 if (new_section(ofl, SHT_DYNAMIC, MSG_ORIG(MSG_SCN_DYNAMIC), 0,
982 if (ofl->ofl_osinterp)
985 osp = ofl->ofl_osdynamic =
986 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynamic, NULL);
991 for (APLIST_TRAVERSE(ofl->ofl_sos, idx, ifl)) {
1007 DBG_CALL(Dbg_util_nl(ofl->ofl_lml, DBG_NL_STD));
1008 DBG_CALL(Dbg_unused_file(ofl->ofl_lml, ifl->ifl_soname,
1018 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_UNUSED) &&
1020 ld_eprintf(ofl, ERR_GUIDANCE,
1045 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1046 ofl->ofl_dtflags |= DF_ORIGIN;
1051 DBG_CALL(Dbg_util_nl(ofl->ofl_lml, DBG_NL_STD));
1057 cnt += alist_nitems(ofl->ofl_dtsfltrs);
1063 SYM_NOHASH, NULL, ofl)) != NULL) &&
1070 SYM_NOHASH, NULL, ofl)) != NULL) &&
1081 if (ofl->ofl_soname) {
1083 if (st_insert(strtbl, ofl->ofl_soname) == -1)
1086 if (ofl->ofl_filtees) {
1088 if (st_insert(strtbl, ofl->ofl_filtees) == -1)
1095 if (strstr(ofl->ofl_filtees,
1097 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1098 ofl->ofl_dtflags |= DF_ORIGIN;
1103 if (ofl->ofl_rpath) {
1105 if (st_insert(strtbl, ofl->ofl_rpath) == -1)
1112 if (strstr(ofl->ofl_rpath, MSG_ORIG(MSG_STR_ORIGIN))) {
1113 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1114 ofl->ofl_dtflags |= DF_ORIGIN;
1122 if (ofl->ofl_config) {
1124 if (st_insert(strtbl, ofl->ofl_config) == -1)
1131 if (strstr(ofl->ofl_config, MSG_ORIG(MSG_STR_ORIGIN))) {
1132 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1133 ofl->ofl_dtflags |= DF_ORIGIN;
1136 if (ofl->ofl_depaudit) {
1138 if (st_insert(strtbl, ofl->ofl_depaudit) == -1)
1141 if (ofl->ofl_audit) {
1143 if (st_insert(strtbl, ofl->ofl_audit) == -1)
1158 if (OFL_ALLOW_LDYNSYM(ofl))
1161 if ((ofl->ofl_dynsymsortcnt > 0) ||
1162 (ofl->ofl_dyntlssortcnt > 0))
1165 if (ofl->ofl_dynsymsortcnt > 0)
1168 if (ofl->ofl_dyntlssortcnt > 0)
1179 if ((flags & FLG_OF_COMREL) && ofl->ofl_relocrelcnt)
1185 if (ofl->ofl_osfiniarray) /* DT_FINI_ARRAY */
1188 if (ofl->ofl_osinitarray) /* DT_INIT_ARRAY */
1191 if (ofl->ofl_ospreinitarray) /* DT_PREINIT_ARRAY & */
1198 if (ofl->ofl_pltcnt)
1204 if (ofl->ofl_pltpad)
1211 if (ofl->ofl_relocsz)
1225 if (ofl->ofl_osmove)
1231 cnt += ofl->ofl_regsymcnt;
1237 for (APLIST_TRAVERSE(ofl->ofl_rtldinfo, idx, sdp))
1245 (sgp->sg_phdr.p_flags & PF_W) && ofl->ofl_osinterp)
1252 if (ofl->ofl_oscap)
1259 if (ofl->ofl_oscapinfo)
1267 if (ofl->ofl_oscapchain)
1277 (*ld_targ.t_mr.mr_mach_make_dynamic)(ofl, &cnt);
1311 ofl->ofl_flags |= FLG_OF_OSABI;
1313 return ((uintptr_t)ofl->ofl_osdynamic);
1320 ld_make_got(Ofl_desc *ofl)
1325 size_t size = (size_t)ofl->ofl_gotcnt * ld_targ.t_m.m_got_entsize;
1326 size_t rsize = (size_t)ofl->ofl_relocgotsz;
1328 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_GOT), 0,
1338 ofl->ofl_osgot = ld_place_section(ofl, isec, NULL,
1340 if (ofl->ofl_osgot == (Os_desc *)S_ERROR)
1343 ofl->ofl_osgot->os_szoutrels = (Xword)rsize;
1352 make_interp(Ofl_desc *ofl)
1357 const char *iname = ofl->ofl_interp;
1363 if (ofl->ofl_flags1 & FLG_OF1_NOINTRP)
1374 if (((ofl->ofl_flags & (FLG_OF_DYNAMIC | FLG_OF_EXEC |
1383 iname = ofl->ofl_interp = ld_targ.t_m.m_def_interp;
1387 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_INTERP), 0,
1395 ofl->ofl_osinterp =
1396 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_interp, NULL);
1397 return ((uintptr_t)ofl->ofl_osinterp);
1407 make_sym_sec(Ofl_desc *ofl, const char *sectname, Word stype, int ident)
1417 if (new_section(ofl, stype, sectname, 0, &isec, &shdr, &data) ==
1421 return (ld_place_section(ofl, isec, NULL, ident, NULL));
1594 make_cap(Ofl_desc *ofl, Word shtype, const char *shname, int ident)
1603 Objcapset *ocapset = &ofl->ofl_ocapset;
1612 if (OFL_IS_STATIC_OBJ(ofl))
1613 strtbl = ofl->ofl_strtab;
1615 strtbl = ofl->ofl_dynstrtab;
1622 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && (ofl->ofl_capsymcnt == 0))
1623 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1630 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && ofl->ofl_capsymcnt &&
1631 (ofl->ofl_capfamilies == NULL)) {
1632 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1633 ld_cap_move_symtoobj(ofl);
1634 ofl->ofl_capsymcnt = 0;
1635 ofl->ofl_capgroups = NULL;
1636 ofl->ofl_flags &= ~FLG_OF_OTOSCAP;
1642 capstr_value(ofl->ofl_lml, CA_SUNW_PLAT, &ocapset->oc_plat, &title);
1643 capstr_value(ofl->ofl_lml, CA_SUNW_MACH, &ocapset->oc_mach, &title);
1644 capmask_value(ofl->ofl_lml, CA_SUNW_HW_2, &ocapset->oc_hw_2, &title);
1645 capmask_value(ofl->ofl_lml, CA_SUNW_HW_1, &ocapset->oc_hw_1, &title);
1646 capmask_value(ofl->ofl_lml, CA_SUNW_SF_1, &ocapset->oc_sf_1, &title);
1680 if (ofl->ofl_capsymcnt) {
1687 size += ofl->ofl_capsymcnt;
1693 if (new_section(ofl, shtype, shname, size, &isec,
1708 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1715 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1730 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1745 ofl->ofl_flags |= FLG_OF_PTCAP;
1749 ofl->ofl_flags |= FLG_OF_PTCAP;
1753 ofl->ofl_flags |= FLG_OF_PTCAP;
1761 if (ofl->ofl_capgroups) {
1764 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx1, cgp)) {
1772 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1787 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1806 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1843 if (((ofl->ofl_flags & FLG_OF_PTCAP) == 0) ||
1852 ld_eprintf(ofl, ERR_WARNING,
1864 if (ofl->ofl_flags & FLG_OF_CAPSTRS)
1870 if ((ofl->ofl_oscap = ld_place_section(ofl, isec,
1879 if (ofl->ofl_capfamilies) {
1880 if ((ofl->ofl_oscapinfo = make_sym_sec(ofl,
1889 if (ofl->ofl_capchaincnt &&
1890 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
1891 if (new_section(ofl, SHT_SUNW_capchain,
1893 ofl->ofl_capchaincnt, &isec, &shdr,
1897 ofl->ofl_oscapchain = ld_place_section(ofl, isec,
1899 if (ofl->ofl_oscapchain == (Os_desc *)S_ERROR)
1912 make_plt(Ofl_desc *ofl)
1918 (((size_t)ofl->ofl_pltcnt + (size_t)ofl->ofl_pltpad) *
1920 size_t rsize = (size_t)ofl->ofl_relocpltsz;
1928 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_PLT), 0,
1940 ofl->ofl_osplt = ld_place_section(ofl, isec, NULL,
1942 if (ofl->ofl_osplt == (Os_desc *)S_ERROR)
1945 ofl->ofl_osplt->os_szoutrels = (Xword)rsize;
1956 make_hash(Ofl_desc *ofl)
1962 Word nsyms = ofl->ofl_globcnt;
1969 if (new_section(ofl, SHT_HASH, MSG_ORIG(MSG_SCN_HASH), 0,
1977 ofl->ofl_oshash =
1978 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_hash, NULL);
1979 if (ofl->ofl_oshash == (Os_desc *)S_ERROR)
1985 ofl->ofl_hashbkts = findprime(nsyms);
1995 cnt = 2 + ofl->ofl_hashbkts + DYNSYM_ALL_CNT(ofl);
2014 make_symtab(Ofl_desc *ofl)
2027 if (new_section(ofl, SHT_SYMTAB, MSG_ORIG(MSG_SCN_SYMTAB), 0,
2035 if ((ofl->ofl_ossymtab = ld_place_section(ofl, isec, NULL,
2044 if ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE) {
2048 if (new_section(ofl, SHT_SYMTAB_SHNDX,
2053 if ((ofl->ofl_ossymshndx = ld_place_section(ofl, xisec, NULL,
2062 symcnt = (size_t)(1 + SYMTAB_ALL_CNT(ofl));
2095 make_dynsym(Ofl_desc *ofl)
2118 allow_ldynsym = OFL_ALLOW_LDYNSYM(ofl);
2124 if (allow_ldynsym && new_section(ofl, SHT_SUNW_LDYNSYM,
2128 if (new_section(ofl, SHT_DYNSYM, MSG_ORIG(MSG_SCN_DYNSYM), 0,
2137 ((ofl->ofl_osldynsym = ld_place_section(ofl, lisec, NULL,
2140 ofl->ofl_osdynsym =
2141 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynsym, NULL);
2142 if (ofl->ofl_osdynsym == (Os_desc *)S_ERROR)
2145 cnt = DYNSYM_ALL_CNT(ofl);
2161 cnt = 1 + ofl->ofl_dynlocscnt + ofl->ofl_dynscopecnt;
2177 make_dynsort(Ofl_desc *ofl)
2184 if (!OFL_ALLOW_LDYNSYM(ofl))
2188 if (ofl->ofl_dynsymsortcnt > 0) {
2189 if (new_section(ofl, SHT_SUNW_symsort,
2190 MSG_ORIG(MSG_SCN_DYNSYMSORT), ofl->ofl_dynsymsortcnt,
2194 if ((ofl->ofl_osdynsymsort = ld_place_section(ofl, isec, NULL,
2200 if (ofl->ofl_dyntlssortcnt > 0) {
2201 if (new_section(ofl, SHT_SUNW_tlssort,
2203 ofl->ofl_dyntlssortcnt, &isec, &shdr, &data) == S_ERROR)
2206 if ((ofl->ofl_osdyntlssort = ld_place_section(ofl, isec, NULL,
2220 make_dyn_shndx(Ofl_desc *ofl, const char *shname, Os_desc *symtab,
2231 if (new_section(ofl, SHT_SYMTAB_SHNDX, shname,
2236 if ((*ret_os = ld_place_section(ofl, isec, NULL,
2249 make_dynsym_shndx(Ofl_desc *ofl)
2255 if (OFL_ALLOW_LDYNSYM(ofl)) {
2256 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_LDYNSYM_SHNDX),
2257 ofl->ofl_osldynsym, &ofl->ofl_osldynshndx) == S_ERROR)
2262 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_DYNSYM_SHNDX),
2263 ofl->ofl_osdynsym, &ofl->ofl_osdynshndx) == S_ERROR)
2274 make_shstrtab(Ofl_desc *ofl)
2281 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_SHSTRTAB),
2289 ofl->ofl_osshstrtab =
2290 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_note, NULL);
2291 if (ofl->ofl_osshstrtab == (Os_desc *)S_ERROR)
2294 size = st_getstrtab_sz(ofl->ofl_shdrsttab);
2307 make_strtab(Ofl_desc *ofl)
2319 if (st_insert(ofl->ofl_strtab, ofl->ofl_name) == -1)
2322 size = st_getstrtab_sz(ofl->ofl_strtab);
2325 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_STRTAB),
2333 ofl->ofl_osstrtab =
2334 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_strtab, NULL);
2335 return ((uintptr_t)ofl->ofl_osstrtab);
2342 make_dynstr(Ofl_desc *ofl)
2353 if (OFL_ALLOW_LDYNSYM(ofl)) {
2354 if (st_insert(ofl->ofl_dynstrtab, ofl->ofl_name) == -1)
2356 ofl->ofl_dynscopecnt++;
2363 if (ofl->ofl_regsyms) {
2366 for (ndx = 0; ndx < ofl->ofl_regsymsno; ndx++) {
2369 if ((sdp = ofl->ofl_regsyms[ndx]) == NULL)
2379 if (st_insert(ofl->ofl_dynstrtab, sdp->sd_name) == -1)
2387 if (ofl->ofl_dtsfltrs != NULL) {
2391 for (ALIST_TRAVERSE(ofl->ofl_dtsfltrs, idx, dftp))
2392 if (st_insert(ofl->ofl_dynstrtab, dftp->dft_str) == -1)
2396 size = st_getstrtab_sz(ofl->ofl_dynstrtab);
2399 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_DYNSTR),
2404 if (!(ofl->ofl_flags & FLG_OF_RELOBJ))
2412 ofl->ofl_osdynstr =
2413 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynstr, NULL);
2414 return ((uintptr_t)ofl->ofl_osdynstr);
2425 make_reloc(Ofl_desc *ofl, Os_desc *osp)
2456 } else if (ofl->ofl_flags & FLG_OF_COMREL) {
2457 size = (ofl->ofl_reloccnt - ofl->ofl_reloccntsub) * relsize;
2461 size = ofl->ofl_relocrelsz;
2471 ofl->ofl_relocsz += (Xword)size;
2473 if (new_section(ofl, ld_targ.t_m.m_rel_sht_type, sectname, 0, &isec,
2480 if (OFL_ALLOW_DYNSYM(ofl) && (sh_flags & SHF_ALLOC))
2491 rosp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_rel, NULL);
2523 ofl->ofl_osrel = rosp;
2529 if (ofl->ofl_osrelhead == (Os_desc *)0)
2530 ofl->ofl_osrelhead = rosp;
2539 make_verneed(Ofl_desc *ofl)
2549 if (new_section(ofl, SHT_SUNW_verneed, MSG_ORIG(MSG_SCN_SUNWVERSION),
2554 data->d_size = ofl->ofl_verneedsz;
2555 shdr->sh_size = (Xword)ofl->ofl_verneedsz;
2557 ofl->ofl_osverneed =
2558 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2559 return ((uintptr_t)ofl->ofl_osverneed);
2569 make_verdef(Ofl_desc *ofl)
2582 vdp = (Ver_desc *)ofl->ofl_verdesc->apl_data[0];
2584 if (OFL_IS_STATIC_OBJ(ofl))
2585 strtab = ofl->ofl_strtab;
2587 strtab = ofl->ofl_dynstrtab;
2596 if (new_section(ofl, SHT_SUNW_verdef, MSG_ORIG(MSG_SCN_SUNWVERSION),
2601 data->d_size = ofl->ofl_verdefsz;
2602 shdr->sh_size = (Xword)ofl->ofl_verdefsz;
2604 ofl->ofl_osverdef =
2605 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2606 return ((uintptr_t)ofl->ofl_osverdef);
2613 ld_make_parexpn_data(Ofl_desc *ofl, size_t size, Xword align)
2620 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
2640 ofl->ofl_isparexpn = isec;
2641 osp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_data, NULL);
2646 ofl->ofl_dynshdrcnt++;
2656 ld_make_sunwmove(Ofl_desc *ofl, int mv_nums)
2666 if (new_section(ofl, SHT_SUNW_move, MSG_ORIG(MSG_SCN_SUNWMOVE),
2676 for (APLIST_TRAVERSE(ofl->ofl_parsyms, idx, sdp)) {
2687 if ((ofl->ofl_osmove = ld_place_section(ofl, isec, NULL, 0, NULL)) ==
2700 strmerge_get_reloc_str(Ofl_desc *ofl, Rel_desc *rsp)
2728 if (ld_reloc_targval_get(ofl, rsp, addr, &str_off) == 0)
2741 * ofl, osp - As passed to ld_make_strmerge().
2751 * Either &ofl->ofl_actrels (active relocations)
2752 * or &ofl->ofl_outrels (output relocations).
2762 strmerge_pass1(Ofl_desc *ofl, Os_desc *osp, Str_tbl *mstrtab,
2794 name = strmerge_get_reloc_str(ofl, rsp);
2815 * ofl - Output file descriptor
2834 ld_make_strmerge(Ofl_desc *ofl, Os_desc *osp, APlist **rel_alpp,
2850 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) != 0)
2924 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2925 &ofl->ofl_actrels) == 0)
2927 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2928 &ofl->ofl_outrels) == 0)
2938 if (new_section_from_template(ofl, isp, data_size,
2953 if (ld_place_section(ofl, mstrsec, NULL, osp->os_identndx, NULL) ==
2969 name = strmerge_get_reloc_str(ofl, rsp);
3074 DBG_CALL(Dbg_sec_discarded(ofl->ofl_lml, isp, mstrsec));
3078 DBG_CALL(Dbg_sec_genstr_compress(ofl->ofl_lml, osp->os_name, data_size,
3115 ld_make_sections(Ofl_desc *ofl)
3117 ofl_flag_t flags = ofl->ofl_flags;
3124 if (make_comment(ofl) == S_ERROR)
3127 if (make_interp(ofl) == S_ERROR)
3133 if (make_cap(ofl, SHT_SUNW_cap, MSG_ORIG(MSG_SCN_SUNWCAP),
3140 if (make_array(ofl, SHT_INIT_ARRAY, MSG_ORIG(MSG_SCN_INITARRAY),
3141 ofl->ofl_initarray) == S_ERROR)
3144 if (make_array(ofl, SHT_FINI_ARRAY, MSG_ORIG(MSG_SCN_FINIARRAY),
3145 ofl->ofl_finiarray) == S_ERROR)
3148 if (make_array(ofl, SHT_PREINIT_ARRAY, MSG_ORIG(MSG_SCN_PREINITARRAY),
3149 ofl->ofl_preiarray) == S_ERROR)
3158 if ((ofl->ofl_pltcnt) || (ofl->ofl_pltpad))
3159 if (make_plt(ofl) == S_ERROR)
3167 if (DBG_ENABLED || (ofl->ofl_flags1 & FLG_OF1_IGNPRC)) {
3168 if (ignore_section_processing(ofl) == S_ERROR)
3177 if (ofl->ofl_flags & FLG_OF_ADJOSCNT)
3178 adjust_os_count(ofl);
3192 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) == 0) {
3198 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3204 (ld_make_strmerge(ofl, osp,
3224 (make_verneed(ofl) == S_ERROR))
3227 (make_verdef(ofl) == S_ERROR))
3230 ((ofl->ofl_osversym = make_sym_sec(ofl,
3240 if ((ofl->ofl_ossyminfo = make_sym_sec(ofl,
3251 if (ofl->ofl_reloccnt) {
3252 if (make_reloc(ofl, NULL) == S_ERROR)
3266 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3272 (osp != ofl->ofl_osplt)) {
3273 if (make_reloc(ofl, osp) == S_ERROR)
3284 if (ofl->ofl_relocrelsz) {
3285 if (make_reloc(ofl, NULL) == S_ERROR)
3295 if (ofl->ofl_osplt && ofl->ofl_relocpltsz) {
3296 if (make_reloc(ofl, ofl->ofl_osplt) == S_ERROR)
3304 if (make_dynamic(ofl) == S_ERROR)
3312 if (make_hash(ofl) == S_ERROR)
3314 if (make_dynstr(ofl) == S_ERROR)
3316 if (make_dynsym(ofl) == S_ERROR)
3318 if (ld_unwind_make_hdr(ofl) == S_ERROR)
3320 if (make_dynsort(ofl) == S_ERROR)
3326 ((flags & FLG_OF_STATIC) && ofl->ofl_osversym)) {
3331 if (ofl->ofl_osdynsym &&
3332 ((ofl->ofl_shdrcnt + 3) >= SHN_LORESERVE)) {
3333 if (make_dynsym_shndx(ofl) == S_ERROR)
3337 if (make_strtab(ofl) == S_ERROR)
3339 if (make_symtab(ofl) == S_ERROR)
3346 if (ofl->ofl_osdynsym &&
3347 ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE)) {
3348 if (make_dynsym_shndx(ofl) == S_ERROR)
3353 if (make_shstrtab(ofl) == S_ERROR)
3361 if (ofl->ofl_osversym || ofl->ofl_ossyminfo) {
3366 if (OFL_IS_STATIC_OBJ(ofl))
3367 osp = ofl->ofl_ossymtab;
3369 osp = ofl->ofl_osdynsym;
3374 if (ofl->ofl_osversym)
3375 update_data_size(ofl->ofl_osversym, cnt);
3377 if (ofl->ofl_ossyminfo)
3378 update_data_size(ofl->ofl_ossyminfo, cnt);
3386 if (ofl->ofl_oscapinfo) {
3395 if (OFL_IS_STATIC_OBJ(ofl))
3396 cnt = SYMTAB_ALL_CNT(ofl);
3398 cnt = DYNSYM_ALL_CNT(ofl);
3400 update_data_size(ofl->ofl_oscapinfo, cnt);
3410 ld_make_data(Ofl_desc *ofl, size_t size)
3416 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
3424 if (aplist_append(&ofl->ofl_mapdata, isec, AL_CNT_OFL_MAPSECS) == NULL)
3435 ld_make_text(Ofl_desc *ofl, size_t size)
3448 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_TEXT), 0,
3475 if (aplist_append(&ofl->ofl_maptext, isec, AL_CNT_OFL_MAPSECS) == NULL)
3482 ld_comdat_validate(Ofl_desc *ofl, Ifl_desc *ifl)
3511 ((gr = ld_get_group(ofl, isp)) != NULL) &&
3521 ld_eprintf(ofl, ERR_FATAL,