Skip to content

Comment on A minimal, complete, and correct ELF fileparent

Comments

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.

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.