{"id":20,"date":"2005-11-17T06:40:45","date_gmt":"2005-11-17T14:40:45","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=20"},"modified":"2005-11-17T06:40:45","modified_gmt":"2005-11-17T14:40:45","slug":"run-time-linker-and-library-symbols","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/run-time-linker-and-library-symbols\/","title":{"rendered":"Run time linker and library symbols"},"content":{"rendered":"<p>\nDid you know that almost all programs are incomplete until you start them? When programmers compile a program, it is only partially complete. When you start a program, the operating system looks at the program and runs another program to make it complete &#8212; called a run time linker. In the case of modern Linux, it&#8217;s usually <tt>\/lib\/ld-linux.so.2<\/tt>. Read the manpage on &#8216;l<a href=\"http:\/\/www.google.com\/search?q=man+ld.so\">d.so<\/a>&#8216; for more information.<\/p>\n<ul>\n<li>You can find out what libraries your program uses with       <tt>ldd \/path\/to\/program<\/tt>.     You can also run it as follows (assuming you&#8217;re using bash\/ksh\/zsh):        <tt>LD_DEBUG=files program<\/tt><\/li>\n<li>Find out what symbols a program uses and from which shared libraries:      <tt>LD_DEBUG=bindings program<\/tt><\/li>\n<li>Have you ever wanted to find out what shared library contains the code or     definition for a function or symbol? David Wheeler shows how you can find     it:        <tt>nm -o \/lib\/* \/usr\/lib\/*\/* | grep symbol_name<\/tt>     Then look for the capital &#8220;T&#8221;. Read the <a href=\"http:\/\/www.dwheeler.com\/program-library\/\">Program Library HOWTO<\/a> by David Wheeler.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Did you know that almost all programs are incomplete until you start them? When programmers compile a program, it is only partially complete. When you start a program, the operating system looks at the program and runs another program to make it complete &#8212; called a run time linker. In the case of modern Linux, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/run-time-linker-and-library-symbols\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Run time linker and library symbols&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,17],"tags":[],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-linux","category-programming","category-tech"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}