{"id":229735,"date":"2026-03-31T16:00:00","date_gmt":"2026-03-31T20:00:00","guid":{"rendered":"https:\/\/news-you-need.com\/index.php\/2026\/03\/31\/how-small-can-a-linux-executable-be\/"},"modified":"2026-03-31T16:25:12","modified_gmt":"2026-03-31T20:25:12","slug":"how-small-can-a-linux-executable-be","status":"publish","type":"post","link":"https:\/\/news-you-need.com\/index.php\/2026\/03\/31\/how-small-can-a-linux-executable-be\/","title":{"rendered":"How Small Can A Linux Executable Be?"},"content":{"rendered":"<p><a href=\"https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/\">How Small Can A Linux Executable Be?<\/a><\/p>\n<p><a href=\"https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/\">https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/<\/a><\/p>\n<p>Publish Date: <a href=\"publish_date]\">2026-03-31 16:00:00<\/a><\/p>\n<p>Source Domain: <a href=\"hackaday.com\">hackaday.com<\/a><\/p>\n<p>With ever increasing sizes of various programs (video games being notorious for this), the question of size optimization comes up more and more often. [Nathan Otterness] shows us how it\u2019s done by minifying a Linux \u201cHello, World!\u201d program to the extreme.<\/p>\n<p>A naive attempt at a minimal hello world in C might land you somewhere about 12-15Kb, but [Nathan] can do much better. He starts by writing everything in assembly, using Linux system calls. This initial version without optimization is 383 bytes. The first major thing to go is the section headers; they are not needed to actually run the program. Now he\u2019s down to 173 bytes. And this is without any shenanigans!<\/p>\n<p><img decoding=\"async\" data-attachment-id=\"1067267\" data-permalink=\"https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/nanoelf-butevensmaller\/\" data-orig-file=\"https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png\" data-orig-size=\"856,197\" data-comments-opened=\"1\" data-image-meta=\"{\"aperture\":\"0\",\"credit\":\"\",\"camera\":\"\",\"caption\":\"\",\"created_timestamp\":\"0\",\"copyright\":\"\",\"focal_length\":\"0\",\"iso\":\"0\",\"shutter_speed\":\"0\",\"title\":\"\",\"orientation\":\"0\"}\" data-image-title=\"nanoelf-butevensmaller\" data-image-description=\"\" data-image-caption=\"\n\n<p>The final tiny ELF file<\/p>\n<p>&#8221; data-medium-file=&#8221;https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?w=400&#8243; data-large-file=&#8221;https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?w=800&#8243; class=&#8221;size-medium wp-image-1067267&#8243; src=&#8221;https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?w=400&#8243; alt=&#8221;A hexdump of the final ELF file, significantly smaller than the original&#8221; width=&#8221;400&#8243; height=&#8221;92&#8243; srcset=&#8221;https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png 856w, https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?resize=250,58 250w, https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?resize=400,92 400w, https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf-butevensmaller.png?resize=800,184 800w&#8221; sizes=&#8221;(max-width: 400px) 100vw, 400px&#8221;\/The final tiny ELF file<\/p>\n<p>The first shenanigans are extreme code size optimizations: by selecting instructions carefully (and in a way a C compiler never would), he shaves another 16 bytes off. But the real shenanigans begin when he starts looking for spaces in the ELF header that he can clobber while the program is still accepted by Linux: now he can move his already tiny x86_64 code into these \u201cvacant\u201d spaces in the ELF and&#8230;<\/p>\n<p><a href=\"https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How Small Can A Linux Executable Be? https:\/\/hackaday.com\/2026\/03\/31\/how-small-can-a-linux-executable-be\/ Publish Date: 2026-03-31 16:00:00 Source Domain: hackaday.com&#8230;<\/p>\n","protected":false},"author":1,"featured_media":229736,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/hackaday.com\/wp-content\/uploads\/2026\/03\/nanoelf.png","fifu_image_alt":"","footnotes":""},"categories":[48],"tags":[71],"class_list":["post-229735","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux"],"_links":{"self":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/229735"}],"collection":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/comments?post=229735"}],"version-history":[{"count":1,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/229735\/revisions"}],"predecessor-version":[{"id":229737,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/posts\/229735\/revisions\/229737"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/media\/229736"}],"wp:attachment":[{"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/media?parent=229735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/categories?post=229735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/news-you-need.com\/index.php\/wp-json\/wp\/v2\/tags?post=229735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}