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

  • Home
  • SEARCH
  • 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 7827553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:56:10+00:00 2026-06-02T09:56:10+00:00

When I link executable elf file dynamically it needs libc.so.6 shared library. When I

  • 0

When I link executable elf file dynamically it needs libc.so.6 shared library.
When I link executable elf file statically it doesn’t need libc.so.6 shared library (it’s not surprise).

Does it mean, that to assemble executable file with –static, linker includes libc.so.6 in it?
If not – what file does linker include? where can I search it?
As far as I know, linker includes static libraries in statically assembled file.

  • 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-02T09:56:13+00:00Added an answer on June 2, 2026 at 9:56 am

    If you link as static, the linker will link all the needed object (.o) files from the static libraries (.a). For example, the following command lists the object files which are included in the libc6 library:

    ar t /usr/lib/libc.a
    

    (the exact path to libc.a of course differs from system to system)

    So answer to your question is no, it will not link the whole libc6 library, but only the needed object files. And also, it doesn’t do anything with libc.so.6, since this is only for dynamic linking. It works with the libc.a – static version of the library.

    According to @janneb comment, the smallest unit to be linked is “section”, so it might not even need to link the whole object files.

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

Sidebar

Related Questions

I have a shared library that I wish to link an executable against using
I'm finding that when I link an executable against a static library (.a), the
When linking an executable, if it does not make reference to any of the
I need to do a rather unusual thing: manually execute an elf executable. I.e.
When you create a link to an executable file intended for download (like say
I am wondering if we able to embed SQlite library into Delphi executable file
I am attempting to link my program executable, but I keep getting errors. Having
I'm currently at a point where I need to link in several modules (basically
I'd like to read some text about the compile-link-load process of a executable. In
I have a C++ executable and I'm dynamically linking against several libraries (Boost, Xerces-c

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.