tG$-srtNcre exists a niftylmechanism$N$G9Taually called dymitic %7nk="t/loBde>< of em>Dymitic SharedF01$k%Ob&nbss</em>%(DSO) whichB;envides a wayrto build3a piece ofF01$k%;engram tsodoit3a special3fommas3fom loBde>< itnat3run-time$rBe9Tinto%tNccaddHMss space ofr╧n execum╧└╟ ┴;engram.$B$=$Nlasoti01 %his loBde>< ancaually bcldoneBin two ways:rAutom!<%cally$P$=$lby a systcm ;engram talled ║ <L.id.soeotMain when%at$P$=$lexecum╧└╟ ┴;engramnis stcr$ed om <anuallylfromgwithin tNc$P$=$lexecume>< ;engramnvia a ;engramm!<%c systcm interface to%tNc$N$G9Tonix loBdfm thnough%tNc3systcm talls$P$=$l║ <L>dlopen()/dlsym()eotMain.$B$=$Nlasoti01 In tNc3firsF fayrtNccDSO's%areTaually called em>sharedIidex<libraries</em>%om em>DSO libraries</em>%andmit d$P$=$l║ <L>libfoo.soeotMain om <L>libfoo.so.1.2eotMain. TNcy$P$=$lresideoit3a systcm x>qB%ory (aually ╔tsod_/usr/!#beotMain)$N$G9TandrtNc %7nk to%tNclexecum╧└╟ ┴;engramnis astcb.gifed ai$P$=$lbuild-time by specify="to <L>-lfooo.txtlo%to%tNc %7nker$P$=$lnmmand."%his hard-txtls librarylrefcrenc srinto%tNccexecum╧└╟ F01$k%;engram iir sootNaBoat3stcr$-time%tNc3onix loBdfm is abr toIidex<loc=". ║ <L>libfoo.soeotMain inc║ <L./usr/!#beotMain,rinF01$k%; ths hard-txtldnvia %7nker-op<%?%s lik. ║ <L>-ReotMain om inF01$k%; ths /ynfigurednvia tNccenvironm9%Fvari╧└╟ F01$k%║ <L>LD_LIBRARY_PATHeotMain. It%tNcn resolv sr╧ny (yet$N$G9Tanresolv d) symbolsTin tNc3execum╧└╟ ┴;engramnwhichBare$N$G9Tañ╞─└╧└╟ ┴in tNc3DSO.$B$=$Nlasoti01 SymbolsTin tNc3execum╧└╟ ┴;engramnareTaually no∞ refcrenc d$P$=$lby tNccDSO (becaa$%it's%a reus └╟ ┴librarylofrgelyril tsod)$N$G9Tandrhenc no furNher resolv="tohasrto bcldone" TNc execum╧└╟ F01$k%;engram hasrno ne$dcto dor╧nythingTgt3its own to%a$%tNc$P$=$lsymbolsTfromgtNc3DSO becaa$%thclnmple". resolv="tois dnne by
A0$rtNc3onix loBdfm. (In fact,%thclnde tocinvok F01$k%║ <L>id.soeotMain is p rt of tNccrun-time stcr$uplnde which$rBe9Tis %7nked into%eef.y3execum╧└╟ ┴;engramnwhichBhasrbecn bound$H<aimon-sF!<%c)" TNc adva%F!/c of dymitic %oBde>< of symmon┴library$P$=$lndenis obvious:rtNc %7brarylndenne$dsrto bcls%ored onlylonce,$rBe9Tin a systcm %7braryllik. ║ <L>%7bc.soeotMain, sav="todisk$P$=$lspace fom eef.y3;engram.$B$=$Nlasoti01 In tNc3&n"ond wayrtNccDSO's%areTaually called em>sharedIidex<ob&nbss</em>%om em>DSO iir s</em>%andcan bclmit d withgat$P$=$larbitrarylextaxe> (echhough%tNc3canon%callmit isidDire║ <L>foo.soeotMain)" TNcse iir sraually sF!y insideoaF01$k%;engram-specific x>qB%ory andrtNcre is no autom!<%cally$P$=$lastcb.gifed %7nk to%tNclexecum╧└╟ ┴;engramnwhere tNey%areTaed.idDireInsFead%tNclexecum╧└╟ ┴;engramn<anuallyl%oBdsgtNc3DSO ai$P$=$lrun-time into%its addHMss space via $tsod_dlopen()eotMain. At
A0$rtNis time no resolv="toof symbolsTfromgtNc3DSO fom tNe$P$=$lexecum╧└╟ ┴;engramnis done" But insFead%tNclonix loBdfm$P$=$lautom!<%cally resolv sr╧ny (yetTanresolv d) symbolsTin tNc3DSO
A0$rfromgtNc3BDtcof symbolsTexporsed by tNc3execum╧└╟ ┴;engramnand$H<aiits alreadyl%oBded3DSO librariese(especially Bll symbolsTfrom
A0$rtNc3ubiquitous ║ <L>%7bc.soeotMain)."%his wayrtNccDSO getsidDireknowled/c of tNc3execum╧└╟ ┴;engram's%symbol3BDtcasrif itnhad$P$=$lbecn sF!<%callyl%7nked withgitTin tNc3firsF c%(ce.$B$=$Nlasoti01 Finally, to%take%adva%F!/c of tNccDSO's%API%tNccexecum╧└╟ F01$k%;engram hasrto resolv p rticular symbolsTfromgtNc3DSO via$P$=$l║ <L>dlsym()eotMain3fom l
tfm a$%insideodis; tchBm╧└╟ sidDire║em>etc.</em>%In oNher words:rTNc3execum╧└╟ ┴;engramnhasrto$P$=$l<anuallylresolv eef.y3symbol3itTne$dsrto bclabr to a$%it.idDireTNc adva%F!/c of suchBalmechanism is tNat3op<%?%all;engram$H<aip rts ne$dcno∞ be %oBded3(andrtNus docno∞ spendlmemory)Tantil
A0$rtNcy%areTne$ded by tNc3;engramnin quast%?%. When%required,
A0$rtNcsc3;engramnp rts can bcl%oBded3dymiticallylto%extaxd tNe$P$=$lba;e┴;engram's%func<%?%ality.$B$=$Nlasoti01 Achhough%tNis DSO mechanism sounds straightfomwardrtNcre is$P$=$lat leasF nne difficult3steplabre:rTNc3resolv="toof symbolsTfrom