How to reduce the size of an executable file written in C++
The example demonstrates how to reduce the size of an executable file using objdump and working with the code
seen from United States
seen from United States

seen from Singapore
seen from France
seen from Japan
seen from Netherlands
seen from United States

seen from United States

seen from Singapore

seen from China
seen from China
seen from Japan
seen from France

seen from Singapore

seen from Singapore

seen from Malaysia
seen from China
seen from Russia
seen from Malaysia

seen from United States
How to reduce the size of an executable file written in C++
The example demonstrates how to reduce the size of an executable file using objdump and working with the code
π¨ π πππππππ ππππ ππ πΆπ©π±π«πΌπ΄π· πππππππ πππππππ
ππππ πππ is a command-line program that is part of the GNU Binutils suite of tools. Itβs used primarily for displaying various information from object files, which are typically produced as intermediate files during the compilation of a program.objdump can show information from a wide range of object file formats, including ELF (Executable and Linkable Format), which is the standard format forβ¦
Using Intel syntax with objdump
By default, the disassembly produced by objdump is in the AT&T format. If you prefer the Intex format though, just use the option "-M intel" when you run objdump.
Objdump command in Linux is used to provide thorough information on object files. This command is mainly used by the programmers who work on compilers, but still its a very handy tool for normal programmers also when it comes to debugging. In this article, we will understand how to use objdump command through some examples.
Useful ld/objcopy Trick: Embedding Binary Blobs in Executables
http://stupefydeveloper.blogspot.com/2008/08/cc-embed-binary-data-into-elf.html
http://burtonini.com/blog/computers/ld-blobs-2007-07-13-15-50
Working Backwards: An Adventure With Objdump and Strace
I was trying to figure out how a specific Linux utility worked. I will call this utility "util". I don't want to name anything specific, just in case ;). The company that made this utility have an SDK, but for the life of me, I couldn't see a mention in their documentation about how I could use an API to mimic util's functionality.Β
I didn't have access to the source or project files, so I couldn't look using the regular means. After much thinking, I thought that maybe I could work through it backwards using objdump and strace.
As I had mentioned in one of my earlier posts, strace is a Linux tool that can show us the system calls that are used by an executable. I wondered if the functionality of util that I was interested in was being implemented using ioctl calls. It turns out that it wasn't, but the beginning of the strace output gave me an interesting lead. I noticed that util was using a specific shared object that was not part of gcc or anything usually Linux related. I decided to look at the symbols listing of this mysterious shared object, using objdump: "objdump -dR libmystery.so". I noticed that there were symbols being exported with very interesting names - names that related to the functionality that I was trying to figure out.
I googled the name of the shared object library that util was using. I saw a changelog talking about my mystery library, and the changelog description mentioned the functionality that I was interested in. I was getting closer! Now I needed to figure out how I could use this shared object library. It turns out, after much (like a lot of) digging in google, I found out that the company who made the utility had just recentlyΒ released the API for what I needed. I was in luck! I found the header file for the API, and tested it out using a small program that linked with the mystery library (the same one that util was using) - it worked.Β Β
I found it really interesting that the SDK documentation that they had didn't mention this API at all. But, at least I got to learn how to use objdump.