Lines Matching refs: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);
172 * ofl->ofl_shdrcnt and remove the section name from the .shstrtab string
173 * table (ofl->ofl_shdrsttab).
179 adjust_os_count(Ofl_desc *ofl)
187 if ((ofl->ofl_flags & FLG_OF_ADJOSCNT) == 0)
195 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
237 ofl->ofl_shdrcnt--;
238 err = st_delstring(ofl->ofl_shdrsttab,
264 ignore_section_processing(Ofl_desc *ofl)
272 int allow_ldynsym = OFL_ALLOW_LDYNSYM(ofl);
275 for (APLIST_TRAVERSE(ofl->ofl_objs, idx1, ifl)) {
282 DBG_CALL(Dbg_unused_file(ofl->ofl_lml,
284 if (((ofl->ofl_flags1 & FLG_OF1_IGNPRC) == 0) ||
335 ignore_sym(ofl, ifl, sdp, allow_ldynsym);
342 if ((ofl->ofl_flags1 & FLG_OF1_IGNPRC) == 0)
349 REL_CACHE_TRAVERSE(&ofl->ofl_outrels, idx1, rcbp, rsp) {
378 ofl->ofl_reloccntsub++;
381 ofl->ofl_relocrelcnt--;
388 ofl->ofl_flags |= FLG_OF_ADJOSCNT;
398 * ofl - Output file descriptor
419 new_section(Ofl_desc *ofl, Word shtype, const char *shname, Xword entcnt,
482 ofl->ofl_flags |= FLG_OF_OSABI;
520 ofl->ofl_flags |= FLG_OF_OSABI;
562 ofl->ofl_flags |= FLG_OF_OSABI;
567 ofl->ofl_flags |= FLG_OF_OSABI;
573 ofl->ofl_flags |= FLG_OF_OSABI;
584 ofl->ofl_flags |= FLG_OF_OSABI;
590 ofl->ofl_flags |= FLG_OF_OSABI;
602 ofl->ofl_flags |= FLG_OF_OSABI;
612 ofl->ofl_flags |= FLG_OF_OSABI;
635 data->d_version = ofl->ofl_dehdr->e_version;
670 * ofl - Output file descriptor
684 new_section_from_template(Ofl_desc *ofl, Is_desc *tmpl_isp, size_t size,
699 data->d_version = ofl->ofl_dehdr->e_version;
736 ld_make_bss(Ofl_desc *ofl, Xword size, Xword align, uint_t ident)
742 Xword rsize = (Xword)ofl->ofl_relocbsssz;
749 if (new_section(ofl, SHT_NOBITS, NULL, 0,
761 ofl->ofl_istlsbss = isec;
766 ofl->ofl_isbss = isec;
772 ofl->ofl_islbss = isec;
781 if ((osp = ld_place_section(ofl, isec, NULL, ident, NULL)) ==
797 if (ofl->ofl_flags1 & flagtotest) {
798 ofl->ofl_dynshdrcnt++;
812 make_array(Ofl_desc *ofl, Word shtype, const char *sectname, APlist *alp)
832 if (new_section(ofl, shtype, sectname, entcount, &isec, &shdr, &data) ==
839 if (ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_array, NULL) ==
845 if ((ofl->ofl_osinitarray == NULL) && (shtype == SHT_INIT_ARRAY))
846 ofl->ofl_osinitarray = osp;
847 if ((ofl->ofl_ospreinitarray == NULL) && (shtype == SHT_PREINIT_ARRAY))
848 ofl->ofl_ospreinitarray = osp;
849 else if ((ofl->ofl_osfiniarray == NULL) && (shtype == SHT_FINI_ARRAY))
850 ofl->ofl_osfiniarray = osp;
876 DBG_CALL(Dbg_reloc_generate(ofl->ofl_lml, osp,
881 if (ld_process_sym_reloc(ofl, &reld, (Rel *)&reloc, isec,
898 make_comment(Ofl_desc *ofl)
904 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_COMMENT), 0,
908 data->d_buf = (void *)ofl->ofl_sgsid;
909 data->d_size = strlen(ofl->ofl_sgsid) + 1;
916 return ((uintptr_t)ld_place_section(ofl, isec, NULL,
929 make_dynamic(Ofl_desc *ofl)
941 ofl_flag_t flags = ofl->ofl_flags;
948 if (OFL_IS_STATIC_OBJ(ofl))
949 strtbl = ofl->ofl_strtab;
951 strtbl = ofl->ofl_dynstrtab;
958 if (new_section(ofl, SHT_DYNAMIC, MSG_ORIG(MSG_SCN_DYNAMIC), 0,
975 if (ofl->ofl_osinterp)
978 osp = ofl->ofl_osdynamic =
979 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynamic, NULL);
984 for (APLIST_TRAVERSE(ofl->ofl_sos, idx, ifl)) {
1000 DBG_CALL(Dbg_util_nl(ofl->ofl_lml, DBG_NL_STD));
1001 DBG_CALL(Dbg_unused_file(ofl->ofl_lml, ifl->ifl_soname,
1011 if (OFL_GUIDANCE(ofl, FLG_OFG_NO_UNUSED) &&
1013 ld_eprintf(ofl, ERR_GUIDANCE,
1038 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1039 ofl->ofl_dtflags |= DF_ORIGIN;
1044 DBG_CALL(Dbg_util_nl(ofl->ofl_lml, DBG_NL_STD));
1050 cnt += alist_nitems(ofl->ofl_dtsfltrs);
1056 SYM_NOHASH, NULL, ofl)) != NULL) &&
1063 SYM_NOHASH, NULL, ofl)) != NULL) &&
1074 if (ofl->ofl_soname) {
1076 if (st_insert(strtbl, ofl->ofl_soname) == -1)
1079 if (ofl->ofl_filtees) {
1081 if (st_insert(strtbl, ofl->ofl_filtees) == -1)
1088 if (strstr(ofl->ofl_filtees,
1090 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1091 ofl->ofl_dtflags |= DF_ORIGIN;
1096 if (ofl->ofl_rpath) {
1098 if (st_insert(strtbl, ofl->ofl_rpath) == -1)
1105 if (strstr(ofl->ofl_rpath, MSG_ORIG(MSG_STR_ORIGIN))) {
1106 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1107 ofl->ofl_dtflags |= DF_ORIGIN;
1115 if (ofl->ofl_config) {
1117 if (st_insert(strtbl, ofl->ofl_config) == -1)
1124 if (strstr(ofl->ofl_config, MSG_ORIG(MSG_STR_ORIGIN))) {
1125 ofl->ofl_dtflags_1 |= DF_1_ORIGIN;
1126 ofl->ofl_dtflags |= DF_ORIGIN;
1129 if (ofl->ofl_depaudit) {
1131 if (st_insert(strtbl, ofl->ofl_depaudit) == -1)
1134 if (ofl->ofl_audit) {
1136 if (st_insert(strtbl, ofl->ofl_audit) == -1)
1151 if (OFL_ALLOW_LDYNSYM(ofl))
1154 if ((ofl->ofl_dynsymsortcnt > 0) ||
1155 (ofl->ofl_dyntlssortcnt > 0))
1158 if (ofl->ofl_dynsymsortcnt > 0)
1161 if (ofl->ofl_dyntlssortcnt > 0)
1172 if ((flags & FLG_OF_COMREL) && ofl->ofl_relocrelcnt)
1178 if (ofl->ofl_osfiniarray) /* DT_FINI_ARRAY */
1181 if (ofl->ofl_osinitarray) /* DT_INIT_ARRAY */
1184 if (ofl->ofl_ospreinitarray) /* DT_PREINIT_ARRAY & */
1191 if (ofl->ofl_pltcnt)
1197 if (ofl->ofl_pltpad)
1204 if (ofl->ofl_relocsz)
1218 if (ofl->ofl_osmove)
1224 cnt += ofl->ofl_regsymcnt;
1230 for (APLIST_TRAVERSE(ofl->ofl_rtldinfo, idx, sdp))
1238 (sgp->sg_phdr.p_flags & PF_W) && ofl->ofl_osinterp)
1245 if (ofl->ofl_oscap)
1252 if (ofl->ofl_oscapinfo)
1260 if (ofl->ofl_oscapchain)
1270 (*ld_targ.t_mr.mr_mach_make_dynamic)(ofl, &cnt);
1304 ofl->ofl_flags |= FLG_OF_OSABI;
1306 return ((uintptr_t)ofl->ofl_osdynamic);
1313 ld_make_got(Ofl_desc *ofl)
1318 size_t size = (size_t)ofl->ofl_gotcnt * ld_targ.t_m.m_got_entsize;
1319 size_t rsize = (size_t)ofl->ofl_relocgotsz;
1321 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_GOT), 0,
1331 ofl->ofl_osgot = ld_place_section(ofl, isec, NULL,
1333 if (ofl->ofl_osgot == (Os_desc *)S_ERROR)
1336 ofl->ofl_osgot->os_szoutrels = (Xword)rsize;
1345 make_interp(Ofl_desc *ofl)
1350 const char *iname = ofl->ofl_interp;
1356 if (ofl->ofl_flags1 & FLG_OF1_NOINTRP)
1367 if (((ofl->ofl_flags & (FLG_OF_DYNAMIC | FLG_OF_EXEC |
1376 iname = ofl->ofl_interp = ld_targ.t_m.m_def_interp;
1380 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_INTERP), 0,
1388 ofl->ofl_osinterp =
1389 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_interp, NULL);
1390 return ((uintptr_t)ofl->ofl_osinterp);
1400 make_sym_sec(Ofl_desc *ofl, const char *sectname, Word stype, int ident)
1410 if (new_section(ofl, stype, sectname, 0, &isec, &shdr, &data) ==
1414 return (ld_place_section(ofl, isec, NULL, ident, NULL));
1587 make_cap(Ofl_desc *ofl, Word shtype, const char *shname, int ident)
1596 Objcapset *ocapset = &ofl->ofl_ocapset;
1605 if (OFL_IS_STATIC_OBJ(ofl))
1606 strtbl = ofl->ofl_strtab;
1608 strtbl = ofl->ofl_dynstrtab;
1615 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && (ofl->ofl_capsymcnt == 0))
1616 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1623 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && ofl->ofl_capsymcnt &&
1624 (ofl->ofl_capfamilies == NULL)) {
1625 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1626 ld_cap_move_symtoobj(ofl);
1627 ofl->ofl_capsymcnt = 0;
1628 ofl->ofl_capgroups = NULL;
1629 ofl->ofl_flags &= ~FLG_OF_OTOSCAP;
1635 capstr_value(ofl->ofl_lml, CA_SUNW_PLAT, &ocapset->oc_plat, &title);
1636 capstr_value(ofl->ofl_lml, CA_SUNW_MACH, &ocapset->oc_mach, &title);
1637 capmask_value(ofl->ofl_lml, CA_SUNW_HW_2, &ocapset->oc_hw_2, &title);
1638 capmask_value(ofl->ofl_lml, CA_SUNW_HW_1, &ocapset->oc_hw_1, &title);
1639 capmask_value(ofl->ofl_lml, CA_SUNW_SF_1, &ocapset->oc_sf_1, &title);
1673 if (ofl->ofl_capsymcnt) {
1680 size += ofl->ofl_capsymcnt;
1686 if (new_section(ofl, shtype, shname, size, &isec,
1701 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1708 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1723 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1738 ofl->ofl_flags |= FLG_OF_PTCAP;
1742 ofl->ofl_flags |= FLG_OF_PTCAP;
1746 ofl->ofl_flags |= FLG_OF_PTCAP;
1754 if (ofl->ofl_capgroups) {
1757 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx1, cgp)) {
1765 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1780 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1799 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1836 if (((ofl->ofl_flags & FLG_OF_PTCAP) == 0) ||
1845 ld_eprintf(ofl, ERR_WARNING,
1857 if (ofl->ofl_flags & FLG_OF_CAPSTRS)
1863 if ((ofl->ofl_oscap = ld_place_section(ofl, isec,
1872 if (ofl->ofl_capfamilies) {
1873 if ((ofl->ofl_oscapinfo = make_sym_sec(ofl,
1882 if (ofl->ofl_capchaincnt &&
1883 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
1884 if (new_section(ofl, SHT_SUNW_capchain,
1886 ofl->ofl_capchaincnt, &isec, &shdr,
1890 ofl->ofl_oscapchain = ld_place_section(ofl, isec,
1892 if (ofl->ofl_oscapchain == (Os_desc *)S_ERROR)
1905 make_plt(Ofl_desc *ofl)
1911 (((size_t)ofl->ofl_pltcnt + (size_t)ofl->ofl_pltpad) *
1913 size_t rsize = (size_t)ofl->ofl_relocpltsz;
1921 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_PLT), 0,
1933 ofl->ofl_osplt = ld_place_section(ofl, isec, NULL,
1935 if (ofl->ofl_osplt == (Os_desc *)S_ERROR)
1938 ofl->ofl_osplt->os_szoutrels = (Xword)rsize;
1949 make_hash(Ofl_desc *ofl)
1955 Word nsyms = ofl->ofl_globcnt;
1962 if (new_section(ofl, SHT_HASH, MSG_ORIG(MSG_SCN_HASH), 0,
1970 ofl->ofl_oshash =
1971 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_hash, NULL);
1972 if (ofl->ofl_oshash == (Os_desc *)S_ERROR)
1978 ofl->ofl_hashbkts = findprime(nsyms);
1988 cnt = 2 + ofl->ofl_hashbkts + DYNSYM_ALL_CNT(ofl);
2007 make_symtab(Ofl_desc *ofl)
2020 if (new_section(ofl, SHT_SYMTAB, MSG_ORIG(MSG_SCN_SYMTAB), 0,
2028 if ((ofl->ofl_ossymtab = ld_place_section(ofl, isec, NULL,
2037 if ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE) {
2041 if (new_section(ofl, SHT_SYMTAB_SHNDX,
2046 if ((ofl->ofl_ossymshndx = ld_place_section(ofl, xisec, NULL,
2055 symcnt = (size_t)(1 + SYMTAB_ALL_CNT(ofl));
2088 make_dynsym(Ofl_desc *ofl)
2111 allow_ldynsym = OFL_ALLOW_LDYNSYM(ofl);
2117 if (allow_ldynsym && new_section(ofl, SHT_SUNW_LDYNSYM,
2121 if (new_section(ofl, SHT_DYNSYM, MSG_ORIG(MSG_SCN_DYNSYM), 0,
2130 ((ofl->ofl_osldynsym = ld_place_section(ofl, lisec, NULL,
2133 ofl->ofl_osdynsym =
2134 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynsym, NULL);
2135 if (ofl->ofl_osdynsym == (Os_desc *)S_ERROR)
2138 cnt = DYNSYM_ALL_CNT(ofl);
2154 cnt = 1 + ofl->ofl_dynlocscnt + ofl->ofl_dynscopecnt;
2170 make_dynsort(Ofl_desc *ofl)
2177 if (!OFL_ALLOW_LDYNSYM(ofl))
2181 if (ofl->ofl_dynsymsortcnt > 0) {
2182 if (new_section(ofl, SHT_SUNW_symsort,
2183 MSG_ORIG(MSG_SCN_DYNSYMSORT), ofl->ofl_dynsymsortcnt,
2187 if ((ofl->ofl_osdynsymsort = ld_place_section(ofl, isec, NULL,
2193 if (ofl->ofl_dyntlssortcnt > 0) {
2194 if (new_section(ofl, SHT_SUNW_tlssort,
2196 ofl->ofl_dyntlssortcnt, &isec, &shdr, &data) == S_ERROR)
2199 if ((ofl->ofl_osdyntlssort = ld_place_section(ofl, isec, NULL,
2213 make_dyn_shndx(Ofl_desc *ofl, const char *shname, Os_desc *symtab,
2224 if (new_section(ofl, SHT_SYMTAB_SHNDX, shname,
2229 if ((*ret_os = ld_place_section(ofl, isec, NULL,
2242 make_dynsym_shndx(Ofl_desc *ofl)
2248 if (OFL_ALLOW_LDYNSYM(ofl)) {
2249 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_LDYNSYM_SHNDX),
2250 ofl->ofl_osldynsym, &ofl->ofl_osldynshndx) == S_ERROR)
2255 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_DYNSYM_SHNDX),
2256 ofl->ofl_osdynsym, &ofl->ofl_osdynshndx) == S_ERROR)
2267 make_shstrtab(Ofl_desc *ofl)
2274 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_SHSTRTAB),
2282 ofl->ofl_osshstrtab =
2283 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_note, NULL);
2284 if (ofl->ofl_osshstrtab == (Os_desc *)S_ERROR)
2287 size = st_getstrtab_sz(ofl->ofl_shdrsttab);
2300 make_strtab(Ofl_desc *ofl)
2312 if (st_insert(ofl->ofl_strtab, ofl->ofl_name) == -1)
2315 size = st_getstrtab_sz(ofl->ofl_strtab);
2318 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_STRTAB),
2326 ofl->ofl_osstrtab =
2327 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_strtab, NULL);
2328 return ((uintptr_t)ofl->ofl_osstrtab);
2335 make_dynstr(Ofl_desc *ofl)
2346 if (OFL_ALLOW_LDYNSYM(ofl)) {
2347 if (st_insert(ofl->ofl_dynstrtab, ofl->ofl_name) == -1)
2349 ofl->ofl_dynscopecnt++;
2356 if (ofl->ofl_regsyms) {
2359 for (ndx = 0; ndx < ofl->ofl_regsymsno; ndx++) {
2362 if ((sdp = ofl->ofl_regsyms[ndx]) == NULL)
2372 if (st_insert(ofl->ofl_dynstrtab, sdp->sd_name) == -1)
2380 if (ofl->ofl_dtsfltrs != NULL) {
2384 for (ALIST_TRAVERSE(ofl->ofl_dtsfltrs, idx, dftp))
2385 if (st_insert(ofl->ofl_dynstrtab, dftp->dft_str) == -1)
2389 size = st_getstrtab_sz(ofl->ofl_dynstrtab);
2392 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_DYNSTR),
2397 if (!(ofl->ofl_flags & FLG_OF_RELOBJ))
2405 ofl->ofl_osdynstr =
2406 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynstr, NULL);
2407 return ((uintptr_t)ofl->ofl_osdynstr);
2418 make_reloc(Ofl_desc *ofl, Os_desc *osp)
2449 } else if (ofl->ofl_flags & FLG_OF_COMREL) {
2450 size = (ofl->ofl_reloccnt - ofl->ofl_reloccntsub) * relsize;
2454 size = ofl->ofl_relocrelsz;
2464 ofl->ofl_relocsz += (Xword)size;
2466 if (new_section(ofl, ld_targ.t_m.m_rel_sht_type, sectname, 0, &isec,
2473 if (OFL_ALLOW_DYNSYM(ofl) && (sh_flags & SHF_ALLOC))
2484 rosp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_rel, NULL);
2516 ofl->ofl_osrel = rosp;
2522 if (ofl->ofl_osrelhead == (Os_desc *)0)
2523 ofl->ofl_osrelhead = rosp;
2532 make_verneed(Ofl_desc *ofl)
2542 if (new_section(ofl, SHT_SUNW_verneed, MSG_ORIG(MSG_SCN_SUNWVERSION),
2547 data->d_size = ofl->ofl_verneedsz;
2548 shdr->sh_size = (Xword)ofl->ofl_verneedsz;
2550 ofl->ofl_osverneed =
2551 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2552 return ((uintptr_t)ofl->ofl_osverneed);
2562 make_verdef(Ofl_desc *ofl)
2575 vdp = (Ver_desc *)ofl->ofl_verdesc->apl_data[0];
2577 if (OFL_IS_STATIC_OBJ(ofl))
2578 strtab = ofl->ofl_strtab;
2580 strtab = ofl->ofl_dynstrtab;
2589 if (new_section(ofl, SHT_SUNW_verdef, MSG_ORIG(MSG_SCN_SUNWVERSION),
2594 data->d_size = ofl->ofl_verdefsz;
2595 shdr->sh_size = (Xword)ofl->ofl_verdefsz;
2597 ofl->ofl_osverdef =
2598 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2599 return ((uintptr_t)ofl->ofl_osverdef);
2606 ld_make_parexpn_data(Ofl_desc *ofl, size_t size, Xword align)
2613 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
2633 ofl->ofl_isparexpn = isec;
2634 osp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_data, NULL);
2639 ofl->ofl_dynshdrcnt++;
2649 ld_make_sunwmove(Ofl_desc *ofl, int mv_nums)
2659 if (new_section(ofl, SHT_SUNW_move, MSG_ORIG(MSG_SCN_SUNWMOVE),
2669 for (APLIST_TRAVERSE(ofl->ofl_parsyms, idx, sdp)) {
2680 if ((ofl->ofl_osmove = ld_place_section(ofl, isec, NULL, 0, NULL)) ==
2693 strmerge_get_reloc_str(Ofl_desc *ofl, Rel_desc *rsp)
2721 if (ld_reloc_targval_get(ofl, rsp, addr, &str_off) == 0)
2734 * ofl, osp - As passed to ld_make_strmerge().
2744 * Either &ofl->ofl_actrels (active relocations)
2745 * or &ofl->ofl_outrels (output relocations).
2755 strmerge_pass1(Ofl_desc *ofl, Os_desc *osp, Str_tbl *mstrtab,
2787 name = strmerge_get_reloc_str(ofl, rsp);
2808 * ofl - Output file descriptor
2827 ld_make_strmerge(Ofl_desc *ofl, Os_desc *osp, APlist **rel_alpp,
2843 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) != 0)
2910 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2911 &ofl->ofl_actrels) == 0)
2913 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2914 &ofl->ofl_outrels) == 0)
2924 if (new_section_from_template(ofl, isp, data_size,
2939 if (ld_place_section(ofl, mstrsec, NULL, osp->os_identndx, NULL) ==
2955 name = strmerge_get_reloc_str(ofl, rsp);
3060 DBG_CALL(Dbg_sec_discarded(ofl->ofl_lml, isp, mstrsec));
3064 DBG_CALL(Dbg_sec_genstr_compress(ofl->ofl_lml, osp->os_name, data_size,
3101 ld_make_sections(Ofl_desc *ofl)
3103 ofl_flag_t flags = ofl->ofl_flags;
3110 if (make_comment(ofl) == S_ERROR)
3113 if (make_interp(ofl) == S_ERROR)
3119 if (make_cap(ofl, SHT_SUNW_cap, MSG_ORIG(MSG_SCN_SUNWCAP),
3126 if (make_array(ofl, SHT_INIT_ARRAY, MSG_ORIG(MSG_SCN_INITARRAY),
3127 ofl->ofl_initarray) == S_ERROR)
3130 if (make_array(ofl, SHT_FINI_ARRAY, MSG_ORIG(MSG_SCN_FINIARRAY),
3131 ofl->ofl_finiarray) == S_ERROR)
3134 if (make_array(ofl, SHT_PREINIT_ARRAY, MSG_ORIG(MSG_SCN_PREINITARRAY),
3135 ofl->ofl_preiarray) == S_ERROR)
3144 if ((ofl->ofl_pltcnt) || (ofl->ofl_pltpad))
3145 if (make_plt(ofl) == S_ERROR)
3153 if (DBG_ENABLED || (ofl->ofl_flags1 & FLG_OF1_IGNPRC)) {
3154 if (ignore_section_processing(ofl) == S_ERROR)
3163 if (ofl->ofl_flags & FLG_OF_ADJOSCNT)
3164 adjust_os_count(ofl);
3178 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) == 0) {
3184 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3190 (ld_make_strmerge(ofl, osp,
3210 (make_verneed(ofl) == S_ERROR))
3213 (make_verdef(ofl) == S_ERROR))
3216 ((ofl->ofl_osversym = make_sym_sec(ofl,
3226 if ((ofl->ofl_ossyminfo = make_sym_sec(ofl,
3237 if (ofl->ofl_reloccnt) {
3238 if (make_reloc(ofl, NULL) == S_ERROR)
3252 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3258 (osp != ofl->ofl_osplt)) {
3259 if (make_reloc(ofl, osp) == S_ERROR)
3270 if (ofl->ofl_relocrelsz) {
3271 if (make_reloc(ofl, NULL) == S_ERROR)
3281 if (ofl->ofl_osplt && ofl->ofl_relocpltsz) {
3282 if (make_reloc(ofl, ofl->ofl_osplt) == S_ERROR)
3290 if (make_dynamic(ofl) == S_ERROR)
3298 if (make_hash(ofl) == S_ERROR)
3300 if (make_dynstr(ofl) == S_ERROR)
3302 if (make_dynsym(ofl) == S_ERROR)
3304 if (ld_unwind_make_hdr(ofl) == S_ERROR)
3306 if (make_dynsort(ofl) == S_ERROR)
3312 ((flags & FLG_OF_STATIC) && ofl->ofl_osversym)) {
3317 if (ofl->ofl_osdynsym &&
3318 ((ofl->ofl_shdrcnt + 3) >= SHN_LORESERVE)) {
3319 if (make_dynsym_shndx(ofl) == S_ERROR)
3323 if (make_strtab(ofl) == S_ERROR)
3325 if (make_symtab(ofl) == S_ERROR)
3332 if (ofl->ofl_osdynsym &&
3333 ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE)) {
3334 if (make_dynsym_shndx(ofl) == S_ERROR)
3339 if (make_shstrtab(ofl) == S_ERROR)
3347 if (ofl->ofl_osversym || ofl->ofl_ossyminfo) {
3352 if (OFL_IS_STATIC_OBJ(ofl))
3353 osp = ofl->ofl_ossymtab;
3355 osp = ofl->ofl_osdynsym;
3360 if (ofl->ofl_osversym)
3361 update_data_size(ofl->ofl_osversym, cnt);
3363 if (ofl->ofl_ossyminfo)
3364 update_data_size(ofl->ofl_ossyminfo, cnt);
3372 if (ofl->ofl_oscapinfo) {
3381 if (OFL_IS_STATIC_OBJ(ofl))
3382 cnt = SYMTAB_ALL_CNT(ofl);
3384 cnt = DYNSYM_ALL_CNT(ofl);
3386 update_data_size(ofl->ofl_oscapinfo, cnt);
3396 ld_make_data(Ofl_desc *ofl, size_t size)
3402 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
3410 if (aplist_append(&ofl->ofl_mapdata, isec, AL_CNT_OFL_MAPSECS) == NULL)
3421 ld_make_text(Ofl_desc *ofl, size_t size)
3434 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_TEXT), 0,
3461 if (aplist_append(&ofl->ofl_maptext, isec, AL_CNT_OFL_MAPSECS) == NULL)