Lines Matching defs:ofl

74 ld_find_got_ndx(Alist *alp, Gotref gref, Ofl_desc *ofl, Rel_desc *rdesc)
81 if ((gref == GOT_REF_TLSLD) && ofl->ofl_tlsldgotndx)
82 return (ofl->ofl_tlsldgotndx);
94 ld_calc_got_offset(Rel_desc *rdesc, Ofl_desc *ofl)
96 Os_desc *osp = ofl->ofl_osgot;
111 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, rdesc);
140 ld_mach_eflags(Ehdr *ehdr, Ofl_desc *ofl)
142 ofl->ofl_dehdr->e_flags |= ehdr->e_flags;
146 ld_mach_make_dynamic(Ofl_desc *ofl, size_t *cnt)
148 if (!(ofl->ofl_flags & FLG_OF_RELOBJ)) {
152 if (ofl->ofl_pltcnt)
158 ld_mach_update_odynamic(Ofl_desc *ofl, Dyn **dyn)
160 if (((ofl->ofl_flags & FLG_OF_RELOBJ) == 0) && ofl->ofl_pltcnt) {
162 if (ofl->ofl_osgot)
163 (*dyn)->d_un.d_ptr = ofl->ofl_osgot->os_shdr->sh_addr;
171 ld_calc_plt_addr(Sym_desc *sdp, Ofl_desc *ofl)
175 value = (Xword)(ofl->ofl_osplt->os_shdr->sh_addr) +
194 plt_entry(Ofl_desc * ofl, Sym_desc * sdp)
200 int bswap = (ofl->ofl_flags1 & FLG_OF1_ENCDIFF) != 0;
205 plt0 = (uchar_t *)(ofl->ofl_osplt->os_outdata->d_buf);
207 gotent = (uchar_t *)(ofl->ofl_osgot->os_outdata->d_buf) + got_off;
214 *(Word *)gotent = ofl->ofl_osplt->os_shdr->sh_addr + plt_off +
224 if (!OFL_DO_RELOC(ofl))
233 val1 = (ofl->ofl_osgot->os_shdr->sh_addr + got_off) -
234 (ofl->ofl_osplt->os_shdr->sh_addr + plt_off) - 0x06;
238 ofl->ofl_lml) == 0) {
239 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLTNFAIL),
252 ofl->ofl_lml) == 0) {
253 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLTNFAIL),
271 ofl->ofl_lml) == 0) {
272 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLTNFAIL),
281 ld_perform_outreloc(Rel_desc * orsp, Ofl_desc * ofl, Boolean *remain_seen)
302 DBG_CALL(Dbg_reloc_discard(ofl->ofl_lml, M_MACH, orsp));
311 ld_adj_movereloc(ofl, orsp);
319 if (ofl->ofl_parsyms &&
323 DBG_CALL(Dbg_move_outsctadj(ofl->ofl_lml, psym));
325 if (ofl->ofl_flags & FLG_OF_RELOBJ)
354 osp = ofl->ofl_osgot;
355 roffset = ld_calc_got_offset(orsp, ofl);
362 osp = ofl->ofl_osplt;
363 roffset = (ofl->ofl_osgot->os_shdr->sh_addr) +
366 if (plt_entry(ofl, sdp) == S_ERROR)
374 osp = ofl->ofl_isbss->is_osdesc;
392 if (!(ofl->ofl_flags & FLG_OF_RELOBJ))
398 relosp = ofl->ofl_osrel;
421 ndx = ofl->ofl_parexpnndx;
443 DBG_CALL(Dbg_reloc_out(ofl, ELF_DBG_LD, SHT_RELA, &rea, relosp->os_name,
462 osp = ofl->ofl_osgot;
464 ld_reloc_remain_entry(orsp, osp, ofl, remain_seen);
536 tls_fixups(Ofl_desc *ofl, Rel_desc *arsp)
571 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
590 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
616 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
661 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
703 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_REL_BADTLSINS),
725 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
740 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
751 ld_do_activerelocs(Ofl_desc *ofl)
757 ofl_flag_t flags = ofl->ofl_flags;
759 if (aplist_nitems(ofl->ofl_actrels.rc_list) != 0)
760 DBG_CALL(Dbg_reloc_doact_title(ofl->ofl_lml));
765 REL_CACHE_TRAVERSE(&ofl->ofl_actrels, idx, rcbp, arsp) {
782 DBG_CALL(Dbg_reloc_discard(ofl->ofl_lml, M_MACH, arsp));
809 if ((ret = tls_fixups(ofl, arsp)) == FIX_ERROR)
820 ld_adj_movereloc(ofl, arsp);
864 value -= ofl->ofl_tlsphdr->p_vaddr;
880 value = ld_calc_plt_addr(sdp, ofl);
888 !ld_reloc_set_aux_osdesc(ofl, arsp, ofl->ofl_osgot))
907 value = ld_calc_plt_addr(sdp, ofl);
944 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
959 DBG_CALL(Dbg_reloc_doact(ofl->ofl_lml, ELF_DBG_LD_ACT,
966 if (ofl->ofl_flags1 & FLG_OF1_ENCDIFF)
974 value -= ofl->ofl_osgot->os_shdr->sh_addr;
984 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
986 value = (Xword)(ofl->ofl_osgot->os_shdr-> sh_addr) +
992 value = (Xword)(ofl->ofl_osgot->os_shdr->
1005 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
1013 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
1025 tlsstatsize = S_ROUND(ofl->ofl_tlsphdr->p_memsz,
1052 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_REL_EMPTYSEC),
1066 DBG_CALL(Dbg_reloc_doact(ofl->ofl_lml, ELF_DBG_LD_ACT,
1071 if ((((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
1072 ofl->ofl_size) || (arsp->rel_roffset >
1077 if (((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
1078 ofl->ofl_size)
1083 ld_eprintf(ofl, class, MSG_INTL(MSG_REL_INVALOFFSET),
1088 (uintptr_t)ofl->ofl_nehdr));
1106 if (OFL_DO_RELOC(ofl)) {
1113 ifl_name, OFL_SWAP_RELOC_DATA(ofl, arsp),
1114 ofl->ofl_lml) == 0) {
1115 ofl->ofl_flags |= FLG_OF_FATAL;
1124 ld_add_outrel(Word flags, Rel_desc *rsp, Ofl_desc *ofl)
1135 if (OFL_IS_STATIC_EXEC(ofl))
1156 ofl->ofl_flags1 |= FLG_OF1_BSSOREL;
1158 ofl->ofl_flags1 |= FLG_OF1_TLSOREL;
1165 ofl->ofl_dynshdrcnt++;
1172 if ((orsp = ld_reloc_enter(ofl, &ofl->ofl_outrels, rsp, flags)) == NULL)
1176 ofl->ofl_relocgotsz += (Xword)sizeof (Rela);
1178 ofl->ofl_relocpltsz += (Xword)sizeof (Rela);
1180 ofl->ofl_relocbsssz += (Xword)sizeof (Rela);
1182 ofl->ofl_relocrelsz += (Xword)sizeof (Rela);
1187 ofl->ofl_relocrelcnt++;
1195 ofl->ofl_reloccnt++;
1201 ofl->ofl_flags |= FLG_OF_BLDGOT;
1207 ofl->ofl_dtflags_1 |= DF_1_DISPRELPND;
1209 if (ofl->ofl_flags & FLG_OF_VERBOSE)
1210 ld_disp_errmsg(MSG_INTL(MSG_REL_DISPREL4), orsp, ofl);
1212 DBG_CALL(Dbg_reloc_ors_entry(ofl->ofl_lml, ELF_DBG_LD, SHT_RELA,
1221 ld_reloc_local(Rel_desc * rsp, Ofl_desc * ofl)
1223 ofl_flag_t flags = ofl->ofl_flags;
1249 return (ld_add_outrel(0, rsp, ofl));
1253 if (ld_add_outrel(FLG_REL_ADVAL, rsp, ofl) == S_ERROR)
1288 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_REL_EXTERNSYM),
1298 return (ld_add_actrel(NULL, rsp, ofl));
1303 ld_reloc_TLS(Boolean local, Rel_desc * rsp, Ofl_desc * ofl)
1307 ofl_flag_t flags = ofl->ofl_flags;
1318 ofl->ofl_dtflags |= DF_STATIC_TLS;
1325 GOT_REF_TLSIE, ofl, rsp)) == NULL) {
1327 if (ld_assign_got_TLS(local, rsp, ofl, sdp,
1337 return (ld_add_actrel(FLG_REL_STLS, rsp, ofl));
1343 rsp, ofl));
1350 return (ld_add_actrel(FLG_REL_STLS, rsp, ofl));
1353 rsp, ofl));
1362 GOT_REF_TLSLD, ofl, rsp)) == NULL)) {
1364 if (ld_assign_got_TLS(local, rsp, ofl, sdp, gnp, GOT_REF_TLSLD,
1370 ofl, rsp)) == NULL)) {
1372 if (ld_assign_got_TLS(local, rsp, ofl, sdp, gnp, GOT_REF_TLSGD,
1379 return (ld_add_actrel(FLG_REL_MTLS, rsp, ofl));
1381 return (ld_add_actrel(FLG_REL_DTLS, rsp, ofl));
1386 ld_assign_got_ndx(Alist **alpp, Gotndx *pgnp, Gotref gref, Ofl_desc *ofl,
1404 gn.gn_gotndx = ofl->ofl_gotcnt;
1407 ofl->ofl_gotcnt += gotents;
1410 if (ofl->ofl_tlsldgotndx == NULL) {
1414 ofl->ofl_tlsldgotndx = gnp;
1440 ld_assign_plt_ndx(Sym_desc * sdp, Ofl_desc *ofl)
1442 sdp->sd_aux->sa_PLTndx = 1 + ofl->ofl_pltcnt++;
1443 sdp->sd_aux->sa_PLTGOTndx = ofl->ofl_gotcnt++;
1444 ofl->ofl_flags |= FLG_OF_BLDGOT;
1460 ld_fillin_gotplt(Ofl_desc *ofl)
1462 int bswap = (ofl->ofl_flags1 & FLG_OF1_ENCDIFF) != 0;
1464 if (ofl->ofl_osgot) {
1468 SYM_NOHASH, NULL, ofl)) != NULL) {
1471 genptr = ((uchar_t *)ofl->ofl_osgot->os_outdata->d_buf +
1493 if ((ofl->ofl_flags & FLG_OF_DYNAMIC) && ofl->ofl_osplt) {
1497 pltent = (uchar_t *)ofl->ofl_osplt->os_outdata->d_buf;
1504 if (!OFL_DO_RELOC(ofl))
1515 val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
1517 ofl->ofl_osplt->os_shdr->sh_addr - 0x06;
1521 bswap, ofl->ofl_lml) == 0) {
1522 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLT0FAIL));
1530 val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
1532 ofl->ofl_osplt->os_shdr->sh_addr - 0x0c;
1536 bswap, ofl->ofl_lml) == 0) {
1537 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLT0FAIL));