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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:11:43+00:00 2026-05-24T08:11:43+00:00

My code is in test.c: int main(){ return 0; } The dynamically shared libraries

  • 0

My code is in test.c:

int main(){
return 0;
}

The dynamically shared libraries the executable compiled from it depends on are:

$ gcc -o test test.c
$ ldd test
    linux-gate.so.1 =>  (0x00783000)
    libc.so.6 => /lib/libc.so.6 (0x00935000)
    /lib/ld-linux.so.2 (0x00ea5000)
  1. I was wondering what roles the three libraries are playing?
  2. Which library does the function main belong to? /lib/libc.so.6?
  3. Which library does return belong to? /lib/libc.so.6?
  4. Are the three libraries all that are dynamically linked by default by gcc?
  5. How can I find out static libraries that gcc links to by default?

Thanks!

  • 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-24T08:11:44+00:00Added an answer on May 24, 2026 at 8:11 am
    1. linux-gate.so isn’t really a shared lib, but a part of the kernel that acts like one and makes fast system calls possible. ld-linux.so is a piece of code that makes loading other shared libraries possible. libc.so is the C library, containing standard functions like printf and strcpy.
    2. main doesn’t belong to any library. It belongs to your program, in the sense that its assembled version is stored entirely in the test binary file.
    3. return is not a function but a C language construct.
    4. No, it also links in libgcc, which is apparently not a shared library on your system (or it would show up) and some startup code. g++ would additionally link in libstdc++.so (the C++ standard library) and libm.so (the math part of the C standard library).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: template<int* a> class base {}; int main() { base<(int*)0> test;
Below is my code (test.c): #include <stdio.h> #include <string.h> int main(int argc, char **argv)
Say I have a test like: void TestSomething(int someParam) { // Test code }
My C code #include <stdio.h> #include <stdlib.h> #include help.h int test(int x, P *ut)
I have the following test-code: CREATE TABLE #Foo (Foo int) INSERT INTO #Foo SELECT
The following code using System.Threading; class Test { volatile int counter = 0; public
Our Java code (not the test code) reads files from the current directory, which
How can you depend on test code from another module in Maven? Example, I
I have this code #include <iostream> using namespace std; class Test{ public: int a;
I have following piece of code: class Test{ private: int id; public: Test(int v):id(v)

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.