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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:22:29+00:00 2026-05-31T04:22:29+00:00

Is there a tool in Linux which maps the different variable in an executable

  • 0

Is there a tool in Linux which maps the different variable in an executable to it corresponding memory segments.

For example, if i have a initialized global variable int x = 10 in my executable, the tool should show that the variable belongs to .data segment of the executable in a format similar to what is shown below.

x .data

  • 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-31T04:22:30+00:00Added an answer on May 31, 2026 at 4:22 am

    If your executable is not stripped, then the nm command (see also Linux manpage for nm) will do what you want – it prints a table of symbol names / addresses / types. It’s got multiple output options; on Linux, the “sysv”-style formatting comes close to giving you what you want. Sample:

    $ nm -f sysv /bin/perl

    Symbols from /bin/perl:

    Name Value Class Type Size Line Section

    Bases.3 |000000000813019c| d | OBJECT|0000000000000014| |.data
    F0convert |00000000080c6905| t | FUNC|00000000000000c6| |.text
    PL_AMG_names |0000000008137c80| D | OBJECT|0000000000000108| |.data
    PL_No |0000000008137904| D | OBJECT|0000000000000004| |.data
    PL_Yes |0000000008137900| D | OBJECT|0000000000000004| |.data
    [ ... ]
    PL_curinterp |0000000008138e88| B | OBJECT|0000000000000004| |.bss
    PL_do_undump |0000000008137910| D | OBJECT|0000000000000001| |.data
    PL_dollarzero_mutex |0000000008138e58| B | OBJECT|0000000000000018| |.bss
    PL_fold |000000000812c020| R | OBJECT|0000000000000100| |.rodata
    PL_fold_locale |0000000008135c80| D | OBJECT|0000000000000100| |.data
    PL_force_link_funcs |0000000008137da0| D | OBJECT|00000000000006c8| |.data
    PL_freq |000000000812c120| R | OBJECT|0000000000000100| |.rodata
    PL_hexdigit |0000000008137908| D | OBJECT|0000000000000004| |.data
    PL_memory_wrap |000000000812bfa3| R | OBJECT|0000000000000013| |.rodata
    [ ... ]
    PerlIO_setpos |0000000008112134| T | FUNC|00000000000000a6| |.text
    PerlIO_sprintf |00000000081122ee| T | FUNC|000000000000002a| |.text
    PerlIO_stdio |0000000008138720| D | OBJECT|0000000000000070| |.data
    PerlIO_stdoutf |0000000008112066| T | FUNC|000000000000003b| |.text
    [ ... ]If you do create an object file from the C sourcecode:

        int x = 10;

    and run that through nm, it gives:

    $ nm -f sysv xxxx.o
    
    
    Symbols from xxxx.o:
    
    Name         Value            Class        Type         Size     Line  Section
    
    x           |0000000000000000|   D  |    OBJECT|0000000000000004|     |.data
    

    Note the Value field reported by it is the address of said symbol, not the contents of the variable.

    If you run strip over it, this table is removed though and all nm tells you is “no symbols”.

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

Sidebar

Related Questions

is there any lightweight command line batch image cropping tool(Linux or Windows) which can
Is there any command line tool for Linux (FreeBSD, etc) which can modify like
Is there a tool on Linux that would allow me to preview Unicode fonts.
Is there a tool or script which easily merges a bunch of JAR files
Is there a tool or a way to find out how much memory consumed
Is there a tool (preferably free) which will translate Oracle's PL/SQL stored procedure language
Is there a .NET obfuscation tool present for Linux? Or is there a class
I would like to know if there is a Linux tool that allows you
I've been asked to implement a tool ( for linux ) which helps with
For memory leaks, there are many tools available such as valgrind, which you can

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.