ELF Format note (14)-segment content, elfformat
Ilocker: Follow Android Security (novice) QQ: 2597294287
A segment is composed of one or more sections, but this is transparent to android linker. linker does not use the section information when loading the program. Therefore, for an so file, modifying the node-related members (e_shoff, e_shentsize, and e_shnum) in the ELF Header will not affect the program running.
A text segment (also called a code segment) contains read-only commands and data. It usually contains the following sections:
Generally, the first LOAD segment of android so is the text segment:
The data segment contains writable data and instructions, which generally include the following sections:
Generally, the second LOAD segment of android so is the data segment:
The information saved in. got and. plt sections is used to support "location-independent code". The. got section will be modified during the dynamic link process.
The type of the. bss section is SHT_NOBITS, indicating that the file does not occupy space. However, bss occupies space in the memory image of a segment. It is usually located at the end of the segment to store uninitialized global variables. Therefore, the p_memsz of the data segment is larger than p_filesz.