ELF Format note (14)-segment content, elfformat

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.