I'm trying to compile an executable (ELF file) that does not use a dynamic loader. I built a cross compiler that compiles mips from linux to be used on a simulator I made. I asserted the flag -static-libgcc on compilation of my hello.cpp file (hello world program). Apparently this is not enough though. Because there is still a segment in my executable which contains the name/path of the dynamic loader. What flags do I use to generate an executable which contains EVERYTHING needed to be run? Do I need to rebuild my cross compiler?
Is there a good resource describing the exact result of each of the gcc flags? I'm not 100% sure whether I'm actually disabling dynamic loading or not. When I use -static I still have the name of a dynamic loader placed into my .interp section of the elf file.