I understand it is possible to compute the size of an ELF file (i.e., where it ends) based on the information found in the header (i.e., e_shoff + (e_shentsize * e_shnum)), assuming that there is a section header table ("SHT"), and the SHT is the last part of the ELF.
However, SHT is not required to load the binary, and I was wondering wether it would be possible to compute the same information if the SHT was missing (e.g, an stripped binary). Can we leverage the program header or other offsets to compute the size programmatically?