Lines Matching refs: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);
519 tls_fixups(Ofl_desc *ofl, Rel_desc *arsp)
550 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
569 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
595 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
621 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
651 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
666 DBG_CALL(Dbg_reloc_transition(ofl->ofl_lml, M_MACH,
677 ld_do_activerelocs(Ofl_desc *ofl)
683 ofl_flag_t flags = ofl->ofl_flags;
685 if (aplist_nitems(ofl->ofl_actrels.rc_list) != 0)
686 DBG_CALL(Dbg_reloc_doact_title(ofl->ofl_lml));
691 REL_CACHE_TRAVERSE(&ofl->ofl_actrels, idx, rcbp, arsp) {
708 DBG_CALL(Dbg_reloc_discard(ofl->ofl_lml, M_MACH, arsp));
735 if ((ret = tls_fixups(ofl, arsp)) == FIX_ERROR)
746 ld_adj_movereloc(ofl, arsp);
790 value -= ofl->ofl_tlsphdr->p_vaddr;
806 value = ld_calc_plt_addr(sdp, ofl);
814 !ld_reloc_set_aux_osdesc(ofl, arsp, ofl->ofl_osgot))
833 value = ld_calc_plt_addr(sdp, ofl);
870 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
885 DBG_CALL(Dbg_reloc_doact(ofl->ofl_lml, ELF_DBG_LD_ACT,
892 if (ofl->ofl_flags1 & FLG_OF1_ENCDIFF)
900 value -= ofl->ofl_osgot->os_shdr->sh_addr;
910 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
912 value = (Xword)(ofl->ofl_osgot->os_shdr-> sh_addr) +
918 value = (Xword)(ofl->ofl_osgot->os_shdr->
931 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
939 gnp = ld_find_got_ndx(sdp->sd_GOTndxs, gref, ofl, arsp);
951 tlsstatsize = S_ROUND(ofl->ofl_tlsphdr->p_memsz,
978 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_REL_EMPTYSEC),
992 DBG_CALL(Dbg_reloc_doact(ofl->ofl_lml, ELF_DBG_LD_ACT,
997 if ((((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
998 ofl->ofl_size) || (arsp->rel_roffset >
1003 if (((uintptr_t)addr - (uintptr_t)ofl->ofl_nehdr) >
1004 ofl->ofl_size)
1009 ld_eprintf(ofl, class, MSG_INTL(MSG_REL_INVALOFFSET),
1014 (uintptr_t)ofl->ofl_nehdr));
1032 if (OFL_DO_RELOC(ofl)) {
1039 ifl_name, OFL_SWAP_RELOC_DATA(ofl, arsp),
1040 ofl->ofl_lml) == 0) {
1041 ofl->ofl_flags |= FLG_OF_FATAL;
1050 ld_add_outrel(Word flags, Rel_desc *rsp, Ofl_desc *ofl)
1061 if (OFL_IS_STATIC_EXEC(ofl))
1082 ofl->ofl_flags1 |= FLG_OF1_BSSOREL;
1084 ofl->ofl_flags1 |= FLG_OF1_TLSOREL;
1091 ofl->ofl_dynshdrcnt++;
1098 if ((orsp = ld_reloc_enter(ofl, &ofl->ofl_outrels, rsp, flags)) == NULL)
1102 ofl->ofl_relocgotsz += (Xword)sizeof (Rela);
1104 ofl->ofl_relocpltsz += (Xword)sizeof (Rela);
1106 ofl->ofl_relocbsssz += (Xword)sizeof (Rela);
1108 ofl->ofl_relocrelsz += (Xword)sizeof (Rela);
1113 ofl->ofl_relocrelcnt++;
1121 ofl->ofl_reloccnt++;
1127 ofl->ofl_flags |= FLG_OF_BLDGOT;
1133 ofl->ofl_dtflags_1 |= DF_1_DISPRELPND;
1135 if (ofl->ofl_flags & FLG_OF_VERBOSE)
1136 ld_disp_errmsg(MSG_INTL(MSG_REL_DISPREL4), orsp, ofl);
1138 DBG_CALL(Dbg_reloc_ors_entry(ofl->ofl_lml, ELF_DBG_LD, SHT_RELA,
1147 ld_reloc_local(Rel_desc * rsp, Ofl_desc * ofl)
1149 ofl_flag_t flags = ofl->ofl_flags;
1175 return (ld_add_outrel(0, rsp, ofl));
1179 if (ld_add_outrel(FLG_REL_ADVAL, rsp, ofl) == S_ERROR)
1214 ld_eprintf(ofl, ERR_WARNING, MSG_INTL(MSG_REL_EXTERNSYM),
1224 return (ld_add_actrel(NULL, rsp, ofl));
1229 ld_reloc_TLS(Boolean local, Rel_desc * rsp, Ofl_desc * ofl)
1233 ofl_flag_t flags = ofl->ofl_flags;
1244 ofl->ofl_dtflags |= DF_STATIC_TLS;
1251 GOT_REF_TLSIE, ofl, rsp)) == NULL) {
1253 if (ld_assign_got_TLS(local, rsp, ofl, sdp,
1263 return (ld_add_actrel(FLG_REL_STLS, rsp, ofl));
1269 rsp, ofl));
1276 return (ld_add_actrel(FLG_REL_STLS, rsp, ofl));
1279 rsp, ofl));
1288 GOT_REF_TLSLD, ofl, rsp)) == NULL)) {
1290 if (ld_assign_got_TLS(local, rsp, ofl, sdp, gnp, GOT_REF_TLSLD,
1296 ofl, rsp)) == NULL)) {
1298 if (ld_assign_got_TLS(local, rsp, ofl, sdp, gnp, GOT_REF_TLSGD,
1305 return (ld_add_actrel(FLG_REL_MTLS, rsp, ofl));
1307 return (ld_add_actrel(FLG_REL_DTLS, rsp, ofl));
1312 ld_assign_got_ndx(Alist **alpp, Gotndx *pgnp, Gotref gref, Ofl_desc *ofl,
1330 gn.gn_gotndx = ofl->ofl_gotcnt;
1333 ofl->ofl_gotcnt += gotents;
1336 if (ofl->ofl_tlsldgotndx == NULL) {
1340 ofl->ofl_tlsldgotndx = gnp;
1366 ld_assign_plt_ndx(Sym_desc * sdp, Ofl_desc *ofl)
1368 sdp->sd_aux->sa_PLTndx = 1 + ofl->ofl_pltcnt++;
1369 sdp->sd_aux->sa_PLTGOTndx = ofl->ofl_gotcnt++;
1370 ofl->ofl_flags |= FLG_OF_BLDGOT;
1386 ld_fillin_gotplt(Ofl_desc *ofl)
1388 int bswap = (ofl->ofl_flags1 & FLG_OF1_ENCDIFF) != 0;
1390 if (ofl->ofl_osgot) {
1394 SYM_NOHASH, NULL, ofl)) != NULL) {
1397 genptr = ((uchar_t *)ofl->ofl_osgot->os_outdata->d_buf +
1419 if ((ofl->ofl_flags & FLG_OF_DYNAMIC) && ofl->ofl_osplt) {
1423 pltent = (uchar_t *)ofl->ofl_osplt->os_outdata->d_buf;
1430 if (!OFL_DO_RELOC(ofl))
1441 val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
1443 ofl->ofl_osplt->os_shdr->sh_addr - 0x06;
1447 bswap, ofl->ofl_lml) == 0) {
1448 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLT0FAIL));
1456 val1 = (ofl->ofl_osgot->os_shdr->sh_addr) +
1458 ofl->ofl_osplt->os_shdr->sh_addr - 0x0c;
1462 bswap, ofl->ofl_lml) == 0) {
1463 ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_PLT_PLT0FAIL));