1

I have read in the bytes of an Elf file and notices that the 2 bytes beginning at 0x10 equals to 0x03. This specifies that the file is a shared object according to Wikipedia.

I feel that it should be equal to 0x02 (Executable object) and cannot find any reference that would indicate why this would be.

Is there a reason that g++ chooses to mark it as a shared object? Running my custom program works fine but I would love to know more about it and alas, Google is not showing the goods.

All other flags look exactly how I would expect them to except for this one.

I compiled using the following:

g++ main.cpp -o main
Patrick Sturm
  • 393
  • 1
  • 13
  • 3
    Does this answer your question? [Why does GCC create a shared object instead of an executable binary according to file?](https://stackoverflow.com/a/34522357/12122460) – kotatsuyaki May 28 '22 at 06:04

0 Answers0