{"id":43,"date":"2010-06-25T23:52:27","date_gmt":"2010-06-25T23:52:27","guid":{"rendered":"https:\/\/blogs.scummvm.org\/toneman\/?p=43"},"modified":"2022-05-21T21:53:57","modified_gmt":"2022-05-21T21:53:57","slug":"objdump-ing","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/toneman\/2010\/06\/25\/objdump-ing\/","title":{"rendered":"objdump-ing"},"content":{"rendered":"<p><span class=\"Apple-style-span\">So I was trying to figure out which relocation types I really need to worry about when it comes to the GP2x-Wiz today. After making a number of tweaks to the incomplete loader to get it to compile, I compiled and linked (with my modified ARM linker script) the game engines into plugins. I tried using &#8220;objdump&#8221; on these plugin files to figure out which relocation types were worth my time, but it kept returning all types as &#8220;unknown&#8221;. After a bit of research, I discovered another program &#8220;readelf&#8221; that successfully dumped relocation types.\u00a0<\/span><span class=\"Apple-style-span\">I noticed, however, that when I\u00a0<i>do<\/i>\u00a0use &#8220;objdump -R&#8221; which dumps a dynamic relocation table, I get output for both the main &#8220;scummvm.wiz&#8221; file and the plugin files. This leads me to believe that the binaries may be PIC, but since the version of objdump I&#8217;m using doesn&#8217;t seem to support ARM (as mentioned before, it couldn&#8217;t detect the relocation types), the reason it&#8217;s outputting a dynamic relocation table could be because it&#8217;s misreading the files, not because the files really are PIC.<\/span><span class=\"Apple-style-span\">\u00a0My goal for this weekend, then, is to become more certain about the nature of the generated files, and then to code for the relocations I may need to worry about, which are listed below (the names of some of these relocations also has me worried about PIC code):<\/span><\/p>\n<ul>\n<li><span class=\"Apple-style-span\">R_ARM_GLOB_DAT<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_JUMP_SLOT<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_COPY<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_PLT32<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_PC24\u00a0<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_BASE_PREL<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_GOT_BREL<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_PC24<\/span><\/li>\n<li><span class=\"Apple-style-span\">R_ARM_ABS32<\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>So I was trying to figure out which relocation types I really need to worry about when it comes to the GP2x-Wiz today. After making a number of tweaks to the incomplete loader to get it to compile, I compiled and linked (with my modified ARM linker script) the game engines into plugins. I tried [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/posts\/43\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/toneman\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}