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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:49:01+00:00 2026-05-20T14:49:01+00:00

In my code I tried to print the address of printf() function. 22834: ./a.out

  • 0

In my code I tried to print the address of printf() function.

22834:   ./a.out
00250000   1372K r-x--  /lib/libc-2.12.1.so
003a7000      8K r----  /lib/libc-2.12.1.so
003a9000      4K rw---  /lib/libc-2.12.1.so
003aa000     12K rw---    [ anon ]
00a14000    112K r-x--  /lib/ld-2.12.1.so
00a30000      4K r----  /lib/ld-2.12.1.so
00a31000      4K rw---  /lib/ld-2.12.1.so
00fb9000      4K r-x--    [ anon ]
08048000      4K r-x--  /home/anirudh/Documents/DUMP/a.out
08049000      4K r----  /home/anirudh/Documents/DUMP/a.out
0804a000      4K rw---  /home/anirudh/Documents/DUMP/a.out
08068000    132K rw---    [ anon ]
b7898000      4K rw---    [ anon ]
b78ac000      8K rw---    [ anon ]
bfc9a000    132K rw---    [ stack ]
 total     1808K

Address of the function "printf()" in HEX = 8048408

I was expecting its address to be a part of

00250000 1372K r-x-- /lib/libc-2.12.1.so
rather than as shown that its code is in this section
08048000 4K r-x-- /home/anirudh/Documents/DUMP/a.out i.e code segment of my code.

I even tried printing the address of a few more functions like getpid() and scanf() but they were all shown to be part of my program’s code segment rather than the libc-2.12.1.so

What is the reason for this ?. Thanks in advance.

  • 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-20T14:49:02+00:00Added an answer on May 20, 2026 at 2:49 pm

    Look at the code that is at the printf address; it is probably just an indirect jump or call that calls into libc. Typically, calls to shared libraries are turned into references to a dispatch function that is patched with (or looks up) the actual address where printf was loaded. If you run readelf -a on your executable and look for the address where you found printf, it will probably be marked as a relocation to be pointed to the actual address in libc.

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

Sidebar

Related Questions

Can i get the source code for a WAMP stack installer somewhere? Any help
I'm in the process of porting some code from Linux to Mac OS X.
I have found this example on StackOverflow: var people = new List<Person> { new
I have a project that adds elements to an AutoCad drawing. I noticed that
I would like to get a sum from a column, with and without a
(please excuse that I didn't use aliases). I would like my query output to
I'm getting an error here that says I haven't defined a method, but it
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
Has anyone got EclipseLink MOXy (I'm using eclipselink 2.1.0) to work with Java 5?
I make a distributed embedded application that will make use of several micro-controllers. The

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.