The method of loading the ELF program (and displaying the memory as a whole from files) is on the page. Thus, the addresses used, file offsets and size should be a multiple of the page size.
However, the program loader is smart enough to deal with sections that do not start or end exactly at the page border, rounding them to the page border, displaying more than required. Therefore, some additional data will be loaded from the file to fill the page, but it should not be accessed so that it does not matter.
In your example, the code segment is loaded at 0x08048000 from offset 0x0 with a size of 0x448. The address and offset are aligned, so the size should be rounded to the full page. The data segment is loaded from 0x08049448 from offset 0x448. They are not aligned, but compatible - the loader is rounded to several pages (0x08049000 and 0x000) and displays on this page. Note that this ends with the same page from the file as the code segment, so the page loads with two different addresses, one for read-only, the other for read-write-behind the scenes. Thus, the code and data all end up visible in two places of the process image, but it doesnβt matter - the code ends with rx at 0x8048000..0x8048447, and the data ends with rw- at 0x8049448..0x804954b, which is all that matters.
source share