Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7658905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:15:45+00:00 2026-05-31T13:15:45+00:00

I see the process image through pmap under linux: 08048000 0 4 0 r-x–

  • 0

I see the process image through pmap under linux:

08048000       0       4       0 r-x--  [my program]

08049000       0       4       4 rw---  [my program]

The three segments above are code, rodata and data segments, which are all aligned to the PAGESIZE(4K),but when I put the command objdump -h, the ELF headers are displayed as follows:

read-only code segment
Load off 0x00000000 vaddr 0x08048000 paddr 0x08048000 align 2**12
     filesz 0x00000448 memsz 0x00000448 flags r-x

read/write data segment
Load off 0x00000448 vaddr 0x08049448 paddr 0x08049448 align 2**12
     filesz 0x000000e8 memsz 0x00000104 flag rw-

It is said in the ELF header, code segment and data segment are addressed from 0x08048000,0x049448 in virtual address seperately, which is different from the process image in memory. I know the code/data segment should be assigned to different PAGESIZE,which can give them different protection permissions. However, how can the program execute if the real virtual is different from the elf binary?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:15:46+00:00Added an answer on May 31, 2026 at 1:15 pm

    The way ELF program loading (and memory mapping in general from files) is on a page basis. So the addresses involved, the offsets in the files, and the size must all be multiples of the page size.

    However, the program loader is smart enough to deal with sections that do not begin or end exactly on a page boundary by rounding them out to the page boundary, mapping more than is required. So some extra data will be loaded from the file to fill out the page, but it shouldn’t be accessed so that should not matter.

    In your example, the code segment loads at address 0x08048000 from offset 0x0, with a size of 0x448. The address and offset are aligned, so just the size needs to be rounded up to a full page. The data segment loads at 0x08049448 from offset 0x448. Those aren’t aligned, but are compatable — the loader rounds both down to a page multiple (0x08049000 and 0x000) and maps in that page. Note that this ends up being the same page from the file as the code segment, so that page is loaded at two different addresses, one read-only, the other read-write-nonshared. So the code and data all ends up visible in two places in the process image, but that is unimportant — the code ends up r-x at 0x8048000..0x8048447 and the data ends up rw- at 0x8049448..0x804954b, which is all that matters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For our code review process we open the details of a shelveset to see
On Linux/NPTL , threads are created as some kind of process. I can see
We have a Mono application under Linux that does image processing on a bunch
Is there a canonical way to test to see if the process has administrative
I'd like to write a batch file that checks to see if a process
I see all sample from nServiceBus to be a standalone process, so can it
In Visual Studio's Attach to Process dialog I can see a Title column for
when I try to fine-tune my process, I see that the waiting channel is
How can I create and run a process from my program with the ability
My purpose is to process one image from image library, and save this image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.