The linker links Some of the separate object files and libraries to form an executable file. In this process, the linker needs to address some of the symbolic references as well as the redirection of the instructions.
In addition, there is a dynamic link process. For example, some symbols are defined in a so file and need to be performed by the dynamic linker to perform some symbolic lookups and address relocation during the loading process. To do this, the dynamic linker needs some information, which is stored in special sections, such as. dynamic.
Sections and segment are for linked views and execution view, and the various materials are confusing to their translation and will be understood slowly.
There are also sections for debugging functions, such as. Debug,. Line. Here is a table describing the special section:
. BSS: Holds uninitialized data, such as uninitialized global variables. Because it is uninitialized, there is no need to occupy any space in the file to record its initial value (so the type is sht_nobits). When the program starts running, the system will clear the memory area of the. BSS map.
. Comment: Save version control information.
. Data/. Data1: Saves the initialized information. They occupy storage space in the file, which differs from. BSS.
. Debug: Saves debugging-related information.
. Dynamic: Saves dynamically linked information.
. DYNSTR: The string required to save the dynamic link. For example, each symbol in the symbol table has a st_name (symbol name), which is the index to the string table, which may be saved in the. Dynstr.
. Dynsym: Saves symbol tables that require dynamic connections.
. Fini/. Init: Saves the instructions to execute when the process exits and initializes, respectively. The init instruction is executed before the program entry point (Main).
. Got: Saves the global offset table.
In Android, GOT is divided into two parts:. GOT and. Got.plt. where the. Got table is used to hold the address of the global variable reference, whereas. GOT.PLT is used to hold the address of the function reference.
. Hash: Saves a symbolic hash table for quickly locating symbols in its corresponding symbol table.
. INTERP: The path name of the ELF program interpreter, such as the dynamic linker under Android.
. Line: Saves the row number information for debugging.
. Note: Save some comment information.
. PLT: Save Process Link Table (procedure linkage tables). Each externally defined function has a corresponding entry in the PLT for locating the address of the external function.
. Relname/. Relaname: Saves the relocation table. For example:. Rel.dyn,. Rel.plt.
. Rodata/. RODATA1: Saves read-only data in the program.
. Shstrtab: Saves a string table, which is the name of the section.
. Strtab: Saves the string table, similar to. dynstr, but the. Dynstr is the name of the symbols that need to be dynamically linked.
. symtab: Save symbol table (non-dynamic link).
. Text: Saves the executable instruction code.
These take the "." The section name for the prefix is reserved for the system. The application can construct its own segment, but it is best not to have the same name as the system defined section, and not to "." Start to avoid potential conflicts.
ELF Format Notes (v)--Special Section