As far as I can tell from reading the ELF specification, there is no requirement that a .text section exist. Yes, a section named .text is reserved for the system, but I can find nothing that says it must exist.
Empirical evidence gathered by using --rename-section from objcopy seems to confirm this reading.
Will this supplement to the ELF spec require that a .text section exist, even if empty?
(Having said all that, I could be completely off base -- if so, I am sorry!)
https://github.com/ietf-wg-bpf/ebpf-docs/blob/47c98affe555e5315ffcbaf6ea9e894eadda9b9c/rst/elf.rst?plain=1#L39
As far as I can tell from reading the ELF specification, there is no requirement that a
.text
section exist. Yes, a section named.text
is reserved for the system, but I can find nothing that says it must exist.Empirical evidence gathered by using
--rename-section
fromobjcopy
seems to confirm this reading.Will this supplement to the ELF spec require that a
.text
section exist, even if empty?(Having said all that, I could be completely off base -- if so, I am sorry!)