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 7756865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:55:55+00:00 2026-06-01T12:55:55+00:00

Given a literal address, how can I determine which section that address falls in?

  • 0

Given a literal address, how can I determine which section that address falls in? Here is an example. From a disassembly of a program, made with ‘objdump’, I obtain a literal address 0x8048520:

80483ea: c7 45 f4 20 85 04 08 movl $0x8048520,-0xc(%ebp)
…

On my platform (Linux 2.6.39, Gentoo) I can obtain a listing of sections simply by running ‘less’ on the ELF file, and see that this address falls within the .rodata section:

[15] .rodata           PROGBITS        08048518 000518 000016 00   A  0   0  4
...

However, I’m looking for a convenient way to do the same thing that does not require visually scanning through and comparing addresses. Suggestions?

  • 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-06-01T12:55:56+00:00Added an answer on June 1, 2026 at 12:55 pm

    Using your example address of 0x8048520:

    objdump -s --start-address=0x8048520 --stop-address=0x8048521 elf_file | grep section | awk '{ print $4 }' | cut -d':' -f 1
    

    In your example, the output of this command would be:

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

Sidebar

Related Questions

Given a literal memory address in hexadecimal format, how can I create a pointer
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
I need to find all substrings from a string that starting with a given
Need to get a value of an enumeration of a given string literal like
Given an Array Literal inside a JavaScript Object, accessing its own object's properties does
Given that these are allowed: char c[] = abc; char c[] = {'a','b','c','\0'} char
A template argument can be a constant expression (§C.5), the address of an object
Given an compile-time constant integer (an object, not a macro), can I combine it
I am trying to write a method that returns a methodinfo class from a
Let's say for example that I have a regular expression like this: The quick

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.