Hacker News new | ask | show | jobs
by boricj 864 days ago
This is acknowledged by the author:

> Technically, the section header table and the section header string table are not needed, but having them sets the stage for adding more sections in the future, namely dynamic linking and debug symbol sections.

3 comments

The author sounds horribly mistaken.

Even dynamically linked executables tables do not need sections!!

It just so happens to be that the runtime symbol table is defined to be the same format as the normal symbol table. Although it shows up as .dynsym, the runtime linker doesn’t find it that way!

Dynamic linking doesn't require section headers, either, just a PT_DYNAMIC program header to refer to the .dynamic section (which in turn refers to .dynsym, .dynstr, .rela.dyn, .init_array, stc.).
> A loadable ELF file needs no sections at all.

Dynamic linking is a process that takes place with loadable ELF files. A loadable ELF file needs no sections at all.