{"id":112,"date":"2014-10-14T18:07:16","date_gmt":"2014-10-14T18:07:16","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=112"},"modified":"2014-10-14T18:11:09","modified_gmt":"2014-10-14T18:11:09","slug":"library-rpath-si-library-runpath","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/library-rpath-si-library-runpath\/","title":{"rendered":"Library rpath si Library runpath"},"content":{"rendered":"<p>ATENTIE, am manarit referintele la librarii (vezi \/etc\/ld.so.conf).<br \/>\nVezi Library rpath si Library runpath cu:<\/p>\n<pre class=\"brush:bash shell\">readelf -d \/usr\/sbin\/httpd<\/pre>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Rpath\">http:\/\/en.wikipedia.org\/wiki\/Rpath<\/a>:<br \/>\nAt run time, if the dynamic linker finds a DT_RUNPATH attribute, it ignores the value of the DT_RPATH attribute, with the effect that LD_LIBRARY_PATH is checked next and the paths in the DT_RUNPATH attribute are only searched after it. This means that in such configurations, the paths in LD_LIBRARY_PATH are searched before those given at link time using -rpath if &#8211;enable-new-dtags was active. The ld dynamic linker does not search DT_RUNPATH locations for transitive dependencies, unlike DT_RPATH. [3] Instead of specifying the -rpath to the linker, the environment variable LD_RUN_PATH can be set to the same effect.<br \/>\n<a href=\"http:\/\/man7.org\/linux\/man-pages\/man8\/ld.so.8.html\">http:\/\/man7.org\/linux\/man-pages\/man8\/ld.so.8.html<\/a>:<\/p>\n<pre>\r\n\tIf a library dependency does not contain a slash, then it is searched for in the following order:\r\n       o  (ELF only) Using the directories specified in the DT_RPATH dynamic\r\n          section attribute of the binary if present and DT_RUNPATH\r\n          attribute does not exist.  Use of DT_RPATH is deprecated.\r\n       o  Using the environment variable LD_LIBRARY_PATH.  Except if the\r\n          executable is a set-user-ID\/set-group-ID binary, in which case it\r\n          is ignored.\r\n       o  (ELF only) Using the directories specified in the DT_RUNPATH\r\n          dynamic section attribute of the binary if present.\r\n       o  From the cache file \/etc\/ld.so.cache, which contains a compiled\r\n          list of candidate libraries previously found in the augmented\r\n          library path.  If, however, the binary was linked with the -z\r\n          nodeflib linker option, libraries in the default library paths are\r\n          skipped.  Libraries installed in hardware capability directories\r\n          (see below) are preferred to other libraries.\r\n       o  In the default path \/lib, and then \/usr\/lib.  If the binary was\r\n          linked with the -z nodeflib linker option, this step is skipped.\t\r\n<\/pre>\n<p>a) ldd \/usr\/sbin\/httpd initial arata libc.so.6 => not found<\/p>\n<pre class=\"brush:bash shell\">\r\nln -s \/ffp\/lib\/libc.so.0 \/ffp\/lib\/libc.so.6\r\nln -s \/ffp\/lib\/libc.so \/ffp\/lib\/libc.so.6\r\nln -s \/lib\/libc.so.6 \/ffp\/lib\/libc.so.6\r\n<\/pre>\n<p>iar acum arata libc.so.6 => \/ffp\/lib\/libc.so.6<br \/>\nLa fel pentru:<\/p>\n<pre class=\"brush:bash shell\">\r\nln -s \/ffp\/lib\/libdl-0.9.33.2.so \/ffp\/lib\/libdl.so.2\r\nln -s \/ffp\/lib\/libcrypt-0.9.33.2.so \/ffp\/lib\/libcrypt.so.1\r\nln -s \/ffp\/lib\/librt-0.9.33.2.so \/ffp\/lib\/librt.so.1\r\nln -s \/ffp\/lib\/libm-0.9.33.2.so \/ffp\/lib\/libm.so.6\r\nln -s \/ffp\/lib\/libcrypto.so.1.0.0 \/ffp\/lib\/libcrypto.so.0.9.8\r\nln -s \/ffp\/lib\/libssl.so.1.0.0 \/ffp\/lib\/libssl.so.0.9.8\r\n<\/pre>\n<p>Nu e bine sa las links de mai sus pt ca in caz de update a so referitele acestor links nu se updateaza:<br \/>\nrm \/ffp\/lib\/libc.so.6 \/ffp\/lib\/libdl.so.2 \/ffp\/lib\/libcrypt.so.1 \/ffp\/lib\/librt.so.1 \/ffp\/lib\/libm.so.6 \/ffp\/lib\/libcrypto.so.0.9.8 \/ffp\/lib\/libssl.so.0.9.8<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ATENTIE, am manarit referintele la librarii (vezi \/etc\/ld.so.conf). Vezi Library rpath si Library runpath cu: readelf -d \/usr\/sbin\/httpd http:\/\/en.wikipedia.org\/wiki\/Rpath: At run time, if the dynamic linker finds a DT_RUNPATH attribute, it ignores the value of the DT_RPATH attribute, with the [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/library-rpath-si-library-runpath\/#more-112\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Library rpath si Library runpath<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,10],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-linux","category-programming"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=112"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}