I am working on a C++ program and the compiled object code from a single 1200-line file (which initializes a rather complex state machine) comes out to nearly a megabyte. What could be making the file so large? Is there a way I can find what takes space inside the object file?
There can be several reasons when object files are bigger than they have to be at minimum:
At first I suggest to check if you're building with debug information, this causes the most bloat in my experience.