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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:12:26+00:00 2026-06-18T15:12:26+00:00

On Linux you can inspect /proc/$PID/pmaps to see the libraries loaded by a particular

  • 0

On Linux you can inspect /proc/$PID/pmaps to see the libraries loaded by a particular program, and a program can open /proc/self/pmaps to examine the libraries it itself has loaded.

I know pmaps will only contain dynamic libraries, and obviously the kernel can’t predict which libraries we might dlopen at a later point, so I expect those aren’t included in /proc/self/maps. But I’m unsure of a few other other scenarios:

  1. Are libraries that have been linked at build time but we haven’t called any function in yet included? My understanding is the Linux delays linking symbols until the first time they are used, so I’m not sure if they’ll show up.

  2. Does pmaps contain all the libraries used recursively? E.g. if I look at each library in pmaps and run ldd on it, and then run ldd on those, ad nauseum, I shouldn’t find any new libraries that weren’t in the original pmaps? I tried this on a couple binaries and it appears to be so but maybe I’m getting lucky.

  • 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-18T15:12:27+00:00Added an answer on June 18, 2026 at 3:12 pm

    Are libraries that have been linked at build time but we haven’t called any function in yet included?

    Yes: the runtime loader will mmap every library that your executable directly depends on, before your program starts running.

    You can find the list of such libraries by running

    readelf -d a.out | grep NEEDED
    

    Does pmaps contain all the libraries used recursively?

    Yes: if a library that you directly depend on itself depends on some other library, the runtime loader will mmap the recursive dependencies as well.

    My understanding is the Linux delays linking symbols until the first time they are used

    That is mosty correct for function symbols, but false for data symbols, which can’t be resolved lazily.

    Also, whether the symbols are resolved lazily or not depends on LD_BIND_NOW environment variable, and on an equivalent setting in the executable dynamic section, controlled by -znow linker flag.

    None of that changes the mmap pciture though; if you have a DT_NEEDED entry for foo.so in your dynamic section, then foo.so will be mmaped (and will show in /proc/self/*map*) independent of lazy or non-lazy resolution.

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

Sidebar

Related Questions

Currently In my embedded linux I can not open multiple ALSA sound stream. What
A program running under Linux can terminate for a number of reasons: the program
Under Linux I can open a directory using opendir and then use readdir to
In Linux I can view or change the ephemeral port range using the /proc/sys/net/ipv4/ip_local_port_range
I am to program a simple shell in linux that can implement various stuffs
Under Linux I can issue a gcc -Wl,--defsym,main=main_x .. However in Mac OSX 10
I need an editor (preferably Linux) which can load OSM maps and allows me
After installing gcc and mpich library in my linux I can compile my codes
What values in the inode struct of the linux kernel can I look at
I'm creating a utility in C++ to be run on Linux which can convert

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.