Search code examples
cassemblylinkerld

What is the address of entry point of a file linked by gnu linker?


I've created a small multiboot complaint kernel that I, until now, used to boot with grub. Now I want to create my own bootloader for it. But I don't know at what address the gnu linker places entry point program. In Microsoft's PE files, there was a specific field called AddressofEntryPoint in _IMAGE_OPTIONAL_HEADER. Is there any such way to find AddressofEntryPoint of a kernel linked by gnu linker (ld)?


Solution

  • It depends on the binary format you use. For ELF, the e_entry member of the main header is what you want.