gcc does not set the mime type. mimetype guesses the appropriate mime type based on the contents of the file. For ELF files (most compiled binaries and shared libraries), the header contains an e_type field that identifies its type. If it is ET_DYN , then mimetype will consider it as a shared library.
By default, gcc / ld creates binaries that set e_type to ET_EXEC , which are detected as application/x-executable . When the -pie command line option is used, a position-independent executable is created that can, like shared libraries, load at different addresses and work. Since this works the same way as in the shared library, to avoid too many changes in the loader, such binaries will be marked as ET_DYN , even if they can be executed directly.
Some Linux distributions, including yours, have set -pie as the default. You can still override this with -no-pie , but the fact that the mime type is incorrectly defined should not be considered an error, and if you do not know what you are doing, you should not override it. -pie allows for some additional security measures that are fundamentally incompatible with -no-pie .
source share