In our ELF files generated using the GCC linker, the top of the ELF file is always the version identifier of the executable code.
This is achieved by creating the version.c file and creating the resulting object file of the 1st linked object in the link command.
However, for one executable, this did not work, and the only difference we can find is that the executable contains a mixture of C and C ++ code, and the version symbol moves somewhere else.
Thus, the question arises: is there a way to guarantee the absolute position of the character in the ELF file so that the character is always at the top of the file either with the linker commands or with the code attribute directives?
source share