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);
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)
1273 if (ofl->ofl_aslr != 0) /* DT_SUNW_ASLR */
1280 (*ld_targ.t_mr.mr_mach_make_dynamic)(ofl, &cnt);
1314 ofl->ofl_flags |= FLG_OF_OSABI;
1316 return ((uintptr_t)ofl->ofl_osdynamic);
1323 ld_make_got(Ofl_desc *ofl)
1328 size_t size = (size_t)ofl->ofl_gotcnt * ld_targ.t_m.m_got_entsize;
1329 size_t rsize = (size_t)ofl->ofl_relocgotsz;
1331 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_GOT), 0,
1341 ofl->ofl_osgot = ld_place_section(ofl, isec, NULL,
1343 if (ofl->ofl_osgot == (Os_desc *)S_ERROR)
1346 ofl->ofl_osgot->os_szoutrels = (Xword)rsize;
1355 make_interp(Ofl_desc *ofl)
1360 const char *iname = ofl->ofl_interp;
1366 if (ofl->ofl_flags1 & FLG_OF1_NOINTRP)
1377 if (((ofl->ofl_flags & (FLG_OF_DYNAMIC | FLG_OF_EXEC |
1386 iname = ofl->ofl_interp = ld_targ.t_m.m_def_interp;
1390 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_INTERP), 0,
1398 ofl->ofl_osinterp =
1399 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_interp, NULL);
1400 return ((uintptr_t)ofl->ofl_osinterp);
1410 make_sym_sec(Ofl_desc *ofl, const char *sectname, Word stype, int ident)
1420 if (new_section(ofl, stype, sectname, 0, &isec, &shdr, &data) ==
1424 return (ld_place_section(ofl, isec, NULL, ident, NULL));
1597 make_cap(Ofl_desc *ofl, Word shtype, const char *shname, int ident)
1606 Objcapset *ocapset = &ofl->ofl_ocapset;
1615 if (OFL_IS_STATIC_OBJ(ofl))
1616 strtbl = ofl->ofl_strtab;
1618 strtbl = ofl->ofl_dynstrtab;
1625 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && (ofl->ofl_capsymcnt == 0))
1626 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1633 if ((ofl->ofl_flags & FLG_OF_OTOSCAP) && ofl->ofl_capsymcnt &&
1634 (ofl->ofl_capfamilies == NULL)) {
1635 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_CAP_NOSYMSFOUND));
1636 ld_cap_move_symtoobj(ofl);
1637 ofl->ofl_capsymcnt = 0;
1638 ofl->ofl_capgroups = NULL;
1639 ofl->ofl_flags &= ~FLG_OF_OTOSCAP;
1645 capstr_value(ofl->ofl_lml, CA_SUNW_PLAT, &ocapset->oc_plat, &title);
1646 capstr_value(ofl->ofl_lml, CA_SUNW_MACH, &ocapset->oc_mach, &title);
1647 capmask_value(ofl->ofl_lml, CA_SUNW_HW_2, &ocapset->oc_hw_2, &title);
1648 capmask_value(ofl->ofl_lml, CA_SUNW_HW_1, &ocapset->oc_hw_1, &title);
1649 capmask_value(ofl->ofl_lml, CA_SUNW_SF_1, &ocapset->oc_sf_1, &title);
1683 if (ofl->ofl_capsymcnt) {
1690 size += ofl->ofl_capsymcnt;
1696 if (new_section(ofl, shtype, shname, size, &isec,
1711 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1718 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1733 ofl->ofl_flags |= (FLG_OF_PTCAP | FLG_OF_CAPSTRS);
1748 ofl->ofl_flags |= FLG_OF_PTCAP;
1752 ofl->ofl_flags |= FLG_OF_PTCAP;
1756 ofl->ofl_flags |= FLG_OF_PTCAP;
1764 if (ofl->ofl_capgroups) {
1767 for (APLIST_TRAVERSE(ofl->ofl_capgroups, idx1, cgp)) {
1775 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1790 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1809 ofl->ofl_flags |= FLG_OF_CAPSTRS;
1846 if (((ofl->ofl_flags & FLG_OF_PTCAP) == 0) ||
1855 ld_eprintf(ofl, ERR_WARNING,
1867 if (ofl->ofl_flags & FLG_OF_CAPSTRS)
1873 if ((ofl->ofl_oscap = ld_place_section(ofl, isec,
1882 if (ofl->ofl_capfamilies) {
1883 if ((ofl->ofl_oscapinfo = make_sym_sec(ofl,
1892 if (ofl->ofl_capchaincnt &&
1893 ((ofl->ofl_flags & FLG_OF_RELOBJ) == 0)) {
1894 if (new_section(ofl, SHT_SUNW_capchain,
1896 ofl->ofl_capchaincnt, &isec, &shdr,
1900 ofl->ofl_oscapchain = ld_place_section(ofl, isec,
1902 if (ofl->ofl_oscapchain == (Os_desc *)S_ERROR)
1915 make_plt(Ofl_desc *ofl)
1921 (((size_t)ofl->ofl_pltcnt + (size_t)ofl->ofl_pltpad) *
1923 size_t rsize = (size_t)ofl->ofl_relocpltsz;
1931 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_PLT), 0,
1943 ofl->ofl_osplt = ld_place_section(ofl, isec, NULL,
1945 if (ofl->ofl_osplt == (Os_desc *)S_ERROR)
1948 ofl->ofl_osplt->os_szoutrels = (Xword)rsize;
1959 make_hash(Ofl_desc *ofl)
1965 Word nsyms = ofl->ofl_globcnt;
1972 if (new_section(ofl, SHT_HASH, MSG_ORIG(MSG_SCN_HASH), 0,
1980 ofl->ofl_oshash =
1981 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_hash, NULL);
1982 if (ofl->ofl_oshash == (Os_desc *)S_ERROR)
1988 ofl->ofl_hashbkts = findprime(nsyms);
1998 cnt = 2 + ofl->ofl_hashbkts + DYNSYM_ALL_CNT(ofl);
2017 make_symtab(Ofl_desc *ofl)
2030 if (new_section(ofl, SHT_SYMTAB, MSG_ORIG(MSG_SCN_SYMTAB), 0,
2038 if ((ofl->ofl_ossymtab = ld_place_section(ofl, isec, NULL,
2047 if ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE) {
2051 if (new_section(ofl, SHT_SYMTAB_SHNDX,
2056 if ((ofl->ofl_ossymshndx = ld_place_section(ofl, xisec, NULL,
2065 symcnt = (size_t)(1 + SYMTAB_ALL_CNT(ofl));
2098 make_dynsym(Ofl_desc *ofl)
2121 allow_ldynsym = OFL_ALLOW_LDYNSYM(ofl);
2127 if (allow_ldynsym && new_section(ofl, SHT_SUNW_LDYNSYM,
2131 if (new_section(ofl, SHT_DYNSYM, MSG_ORIG(MSG_SCN_DYNSYM), 0,
2140 ((ofl->ofl_osldynsym = ld_place_section(ofl, lisec, NULL,
2143 ofl->ofl_osdynsym =
2144 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynsym, NULL);
2145 if (ofl->ofl_osdynsym == (Os_desc *)S_ERROR)
2148 cnt = DYNSYM_ALL_CNT(ofl);
2164 cnt = 1 + ofl->ofl_dynlocscnt + ofl->ofl_dynscopecnt;
2180 make_dynsort(Ofl_desc *ofl)
2187 if (!OFL_ALLOW_LDYNSYM(ofl))
2191 if (ofl->ofl_dynsymsortcnt > 0) {
2192 if (new_section(ofl, SHT_SUNW_symsort,
2193 MSG_ORIG(MSG_SCN_DYNSYMSORT), ofl->ofl_dynsymsortcnt,
2197 if ((ofl->ofl_osdynsymsort = ld_place_section(ofl, isec, NULL,
2203 if (ofl->ofl_dyntlssortcnt > 0) {
2204 if (new_section(ofl, SHT_SUNW_tlssort,
2206 ofl->ofl_dyntlssortcnt, &isec, &shdr, &data) == S_ERROR)
2209 if ((ofl->ofl_osdyntlssort = ld_place_section(ofl, isec, NULL,
2223 make_dyn_shndx(Ofl_desc *ofl, const char *shname, Os_desc *symtab,
2234 if (new_section(ofl, SHT_SYMTAB_SHNDX, shname,
2239 if ((*ret_os = ld_place_section(ofl, isec, NULL,
2252 make_dynsym_shndx(Ofl_desc *ofl)
2258 if (OFL_ALLOW_LDYNSYM(ofl)) {
2259 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_LDYNSYM_SHNDX),
2260 ofl->ofl_osldynsym, &ofl->ofl_osldynshndx) == S_ERROR)
2265 if (make_dyn_shndx(ofl, MSG_ORIG(MSG_SCN_DYNSYM_SHNDX),
2266 ofl->ofl_osdynsym, &ofl->ofl_osdynshndx) == S_ERROR)
2277 make_shstrtab(Ofl_desc *ofl)
2284 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_SHSTRTAB),
2292 ofl->ofl_osshstrtab =
2293 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_note, NULL);
2294 if (ofl->ofl_osshstrtab == (Os_desc *)S_ERROR)
2297 size = st_getstrtab_sz(ofl->ofl_shdrsttab);
2310 make_strtab(Ofl_desc *ofl)
2322 if (st_insert(ofl->ofl_strtab, ofl->ofl_name) == -1)
2325 size = st_getstrtab_sz(ofl->ofl_strtab);
2328 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_STRTAB),
2336 ofl->ofl_osstrtab =
2337 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_strtab, NULL);
2338 return ((uintptr_t)ofl->ofl_osstrtab);
2345 make_dynstr(Ofl_desc *ofl)
2356 if (OFL_ALLOW_LDYNSYM(ofl)) {
2357 if (st_insert(ofl->ofl_dynstrtab, ofl->ofl_name) == -1)
2359 ofl->ofl_dynscopecnt++;
2366 if (ofl->ofl_regsyms) {
2369 for (ndx = 0; ndx < ofl->ofl_regsymsno; ndx++) {
2372 if ((sdp = ofl->ofl_regsyms[ndx]) == NULL)
2382 if (st_insert(ofl->ofl_dynstrtab, sdp->sd_name) == -1)
2390 if (ofl->ofl_dtsfltrs != NULL) {
2394 for (ALIST_TRAVERSE(ofl->ofl_dtsfltrs, idx, dftp))
2395 if (st_insert(ofl->ofl_dynstrtab, dftp->dft_str) == -1)
2399 size = st_getstrtab_sz(ofl->ofl_dynstrtab);
2402 if (new_section(ofl, SHT_STRTAB, MSG_ORIG(MSG_SCN_DYNSTR),
2407 if (!(ofl->ofl_flags & FLG_OF_RELOBJ))
2415 ofl->ofl_osdynstr =
2416 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_dynstr, NULL);
2417 return ((uintptr_t)ofl->ofl_osdynstr);
2428 make_reloc(Ofl_desc *ofl, Os_desc *osp)
2459 } else if (ofl->ofl_flags & FLG_OF_COMREL) {
2460 size = (ofl->ofl_reloccnt - ofl->ofl_reloccntsub) * relsize;
2464 size = ofl->ofl_relocrelsz;
2474 ofl->ofl_relocsz += (Xword)size;
2476 if (new_section(ofl, ld_targ.t_m.m_rel_sht_type, sectname, 0, &isec,
2483 if (OFL_ALLOW_DYNSYM(ofl) && (sh_flags & SHF_ALLOC))
2494 rosp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_rel, NULL);
2526 ofl->ofl_osrel = rosp;
2532 if (ofl->ofl_osrelhead == (Os_desc *)0)
2533 ofl->ofl_osrelhead = rosp;
2542 make_verneed(Ofl_desc *ofl)
2552 if (new_section(ofl, SHT_SUNW_verneed, MSG_ORIG(MSG_SCN_SUNWVERSION),
2557 data->d_size = ofl->ofl_verneedsz;
2558 shdr->sh_size = (Xword)ofl->ofl_verneedsz;
2560 ofl->ofl_osverneed =
2561 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2562 return ((uintptr_t)ofl->ofl_osverneed);
2572 make_verdef(Ofl_desc *ofl)
2585 vdp = (Ver_desc *)ofl->ofl_verdesc->apl_data[0];
2587 if (OFL_IS_STATIC_OBJ(ofl))
2588 strtab = ofl->ofl_strtab;
2590 strtab = ofl->ofl_dynstrtab;
2599 if (new_section(ofl, SHT_SUNW_verdef, MSG_ORIG(MSG_SCN_SUNWVERSION),
2604 data->d_size = ofl->ofl_verdefsz;
2605 shdr->sh_size = (Xword)ofl->ofl_verdefsz;
2607 ofl->ofl_osverdef =
2608 ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_version, NULL);
2609 return ((uintptr_t)ofl->ofl_osverdef);
2616 ld_make_parexpn_data(Ofl_desc *ofl, size_t size, Xword align)
2623 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
2643 ofl->ofl_isparexpn = isec;
2644 osp = ld_place_section(ofl, isec, NULL, ld_targ.t_id.id_data, NULL);
2649 ofl->ofl_dynshdrcnt++;
2659 ld_make_sunwmove(Ofl_desc *ofl, int mv_nums)
2669 if (new_section(ofl, SHT_SUNW_move, MSG_ORIG(MSG_SCN_SUNWMOVE),
2679 for (APLIST_TRAVERSE(ofl->ofl_parsyms, idx, sdp)) {
2690 if ((ofl->ofl_osmove = ld_place_section(ofl, isec, NULL, 0, NULL)) ==
2703 strmerge_get_reloc_str(Ofl_desc *ofl, Rel_desc *rsp)
2731 if (ld_reloc_targval_get(ofl, rsp, addr, &str_off) == 0)
2744 * ofl, osp - As passed to ld_make_strmerge().
2754 * Either &ofl->ofl_actrels (active relocations)
2755 * or &ofl->ofl_outrels (output relocations).
2765 strmerge_pass1(Ofl_desc *ofl, Os_desc *osp, Str_tbl *mstrtab,
2797 name = strmerge_get_reloc_str(ofl, rsp);
2818 * ofl - Output file descriptor
2837 ld_make_strmerge(Ofl_desc *ofl, Os_desc *osp, APlist **rel_alpp,
2853 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) != 0)
2927 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2928 &ofl->ofl_actrels) == 0)
2930 if (strmerge_pass1(ofl, osp, mstrtab, rel_alpp, sym_alpp,
2931 &ofl->ofl_outrels) == 0)
2941 if (new_section_from_template(ofl, isp, data_size,
2956 if (ld_place_section(ofl, mstrsec, NULL, osp->os_identndx, NULL) ==
2972 name = strmerge_get_reloc_str(ofl, rsp);
3077 DBG_CALL(Dbg_sec_discarded(ofl->ofl_lml, isp, mstrsec));
3081 DBG_CALL(Dbg_sec_genstr_compress(ofl->ofl_lml, osp->os_name, data_size,
3118 ld_make_sections(Ofl_desc *ofl)
3120 ofl_flag_t flags = ofl->ofl_flags;
3127 if (make_comment(ofl) == S_ERROR)
3130 if (make_interp(ofl) == S_ERROR)
3136 if (make_cap(ofl, SHT_SUNW_cap, MSG_ORIG(MSG_SCN_SUNWCAP),
3143 if (make_array(ofl, SHT_INIT_ARRAY, MSG_ORIG(MSG_SCN_INITARRAY),
3144 ofl->ofl_initarray) == S_ERROR)
3147 if (make_array(ofl, SHT_FINI_ARRAY, MSG_ORIG(MSG_SCN_FINIARRAY),
3148 ofl->ofl_finiarray) == S_ERROR)
3151 if (make_array(ofl, SHT_PREINIT_ARRAY, MSG_ORIG(MSG_SCN_PREINITARRAY),
3152 ofl->ofl_preiarray) == S_ERROR)
3161 if ((ofl->ofl_pltcnt) || (ofl->ofl_pltpad))
3162 if (make_plt(ofl) == S_ERROR)
3170 if (DBG_ENABLED || (ofl->ofl_flags1 & FLG_OF1_IGNPRC)) {
3171 if (ignore_section_processing(ofl) == S_ERROR)
3180 if (ofl->ofl_flags & FLG_OF_ADJOSCNT)
3181 adjust_os_count(ofl);
3195 if ((ofl->ofl_flags1 & FLG_OF1_NCSTTAB) == 0) {
3201 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3207 (ld_make_strmerge(ofl, osp,
3227 (make_verneed(ofl) == S_ERROR))
3230 (make_verdef(ofl) == S_ERROR))
3233 ((ofl->ofl_osversym = make_sym_sec(ofl,
3243 if ((ofl->ofl_ossyminfo = make_sym_sec(ofl,
3254 if (ofl->ofl_reloccnt) {
3255 if (make_reloc(ofl, NULL) == S_ERROR)
3269 for (APLIST_TRAVERSE(ofl->ofl_segs, idx1, sgp)) {
3275 (osp != ofl->ofl_osplt)) {
3276 if (make_reloc(ofl, osp) == S_ERROR)
3287 if (ofl->ofl_relocrelsz) {
3288 if (make_reloc(ofl, NULL) == S_ERROR)
3298 if (ofl->ofl_osplt && ofl->ofl_relocpltsz) {
3299 if (make_reloc(ofl, ofl->ofl_osplt) == S_ERROR)
3307 if (make_dynamic(ofl) == S_ERROR)
3315 if (make_hash(ofl) == S_ERROR)
3317 if (make_dynstr(ofl) == S_ERROR)
3319 if (make_dynsym(ofl) == S_ERROR)
3321 if (ld_unwind_make_hdr(ofl) == S_ERROR)
3323 if (make_dynsort(ofl) == S_ERROR)
3329 ((flags & FLG_OF_STATIC) && ofl->ofl_osversym)) {
3334 if (ofl->ofl_osdynsym &&
3335 ((ofl->ofl_shdrcnt + 3) >= SHN_LORESERVE)) {
3336 if (make_dynsym_shndx(ofl) == S_ERROR)
3340 if (make_strtab(ofl) == S_ERROR)
3342 if (make_symtab(ofl) == S_ERROR)
3349 if (ofl->ofl_osdynsym &&
3350 ((ofl->ofl_shdrcnt + 1) >= SHN_LORESERVE)) {
3351 if (make_dynsym_shndx(ofl) == S_ERROR)
3356 if (make_shstrtab(ofl) == S_ERROR)
3364 if (ofl->ofl_osversym || ofl->ofl_ossyminfo) {
3369 if (OFL_IS_STATIC_OBJ(ofl))
3370 osp = ofl->ofl_ossymtab;
3372 osp = ofl->ofl_osdynsym;
3377 if (ofl->ofl_osversym)
3378 update_data_size(ofl->ofl_osversym, cnt);
3380 if (ofl->ofl_ossyminfo)
3381 update_data_size(ofl->ofl_ossyminfo, cnt);
3389 if (ofl->ofl_oscapinfo) {
3398 if (OFL_IS_STATIC_OBJ(ofl))
3399 cnt = SYMTAB_ALL_CNT(ofl);
3401 cnt = DYNSYM_ALL_CNT(ofl);
3403 update_data_size(ofl->ofl_oscapinfo, cnt);
3413 ld_make_data(Ofl_desc *ofl, size_t size)
3419 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_DATA), 0,
3427 if (aplist_append(&ofl->ofl_mapdata, isec, AL_CNT_OFL_MAPSECS) == NULL)
3438 ld_make_text(Ofl_desc *ofl, size_t size)
3451 if (new_section(ofl, SHT_PROGBITS, MSG_ORIG(MSG_SCN_TEXT), 0,
3478 if (aplist_append(&ofl->ofl_maptext, isec, AL_CNT_OFL_MAPSECS) == NULL)
3485 ld_comdat_validate(Ofl_desc *ofl, Ifl_desc *ifl)
3514 ((gr = ld_get_group(ofl, isp)) != NULL) &&
3524 ld_eprintf(ofl, ERR_FATAL,