Segments or sections are contiguous divisions in object and executable files, like chapters in a book. The stack and bss sections do not exist in the file, but are created at runtime.
The point of the sections is mainly to divide the program into areas that the operating system can protect in different ways. To ensure this, sections should begin at the borders of the page and be contiguous in memory.
Main ("important") sections ...
text or code - the OS will protect this section from writing and, since it is unchanged, it can also share it between several processes or threads that execute the same executable file
data - OS will display this r / w and will not directly 1 share it
bss - this section consists of zero initialized data.
the stack is usually separate from the program, it usually grows down from higher addresses
The last two sections are not in the executable file, because they do not need engineering.
If you ask how they are implemented, the assembler and linker create a table of contents and write sections in binary, like chapters in a book. Then the OS reads them separately and puts them in different sections of the address space.
Specificity and terminology differ between Unix-like systems and Windows, but the principles are the same.
1. Yes, yes, copy-by-copy also allows you to transfer data.Digitaloss
source share