How to execute an object file: Part 1
Ever wondered if it is possible to execute an object file without linking? Or use any object file as a library? Follow along to learn how to decompose an object file and import code from it along the way.
Calling a simple function without linking When we write software using a high-level compiled programming language, there are usually a number of steps involved in transforming our source code into the final executable binary: First, our source files are compiled by a compiler translating the high-level programming language into machine code. The output of the compiler is a number of object files. If the project contains multiple source files, we usually get as many object files. The next step is the linker: since the code in different object files may reference each other, the linker is…
saved by
related reading
- A Whirlwind Tutorial on Creating Really Teensy ELF Executables for Linuxmuppetlabs.com
- c++ - What do linkers do? - Stack Overflowstackoverflow.com
- The "Basics" | Putting the "You" in CPUcpu.land
- What happens when you run 'Hello, world'jvns.ca
- Write your Own Virtual Machinejmeiners.com
- The Lost Art of Structure Packingcatb.org
- A Gentle Introduction to LLVM IR · mcyoungmcyoung.xyz
- Writing a C compiler in 500 lines of Pythonvgel.me
- Linkers part 4 – Airs – Ian Lance Taylorairs.com
- Get better at programming by learning how things workjvns.ca
- What Every C Programmer Should Know About Undefined Behavior #2/3 - The LLVM Project Blogblog.llvm.org
- Getting silly with C, part -5^-7 - lcamtuf’s thinglcamtuf.substack.com