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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:06:32+00:00 2026-06-13T08:06:32+00:00

The commands gcc main.c -o main ldd main yield linux-gate.so.1 => (0x00f67000) libc.so.6 =>

  • 0

The commands

gcc main.c -o main
ldd main

yield

linux-gate.so.1 => (0x00f67000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x00b7d000)
/lib/ld-linux.so.2 (0x00ae5000)

Is it possible to change the address where libc.so.6 will be mapped in memory? For example, have libc.so.6 instead be mapped at, say, 0xb0000000.

I’m running Xubuntu 32bit: Linux 3.2.0-23-generic i686 i686 i386 GNU/Linux

  • 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-13T08:06:34+00:00Added an answer on June 13, 2026 at 8:06 am

    There is an prelink utility (wiki page) which is capable of changing loading address (it is called "base address") of so libs.

    There is some info about how prelink works: http://www.acsu.buffalo.edu/~charngda/elf.html

    What does this prelink do? It changes the base address of a dynamic library to the actual address in the user program’s address space when it is loaded into memory. Of course, ld.so recognizes GNU_PRELINKED tag and will load a dynamic library to its this base address (recall the first argument of mmap is the preferred address; of course, this is subject to the operating system.)

    Normally, a dynamic library is built as position independent code, i.e. the -fPIC compiler command-line option, and thus the base address is 0. For example, a normal libc.so has ELF program header as follows (readelf -l command)…

    According to man prelink there is an option of prelink utility to rebase (relocate) given library to specified address:

    -r --reloc-only=ADDRESS
    Instead of prelinking, just relink given shared libraries to the specified base address.

    The prelink --reloc-only=0x7896000 libc.so.6 should be enough to achieve the change you want.

    PS: you can do this relocation on your local copy of libc and then give the path to it via export LD_LIBRARY_PATH=/path/to/your/rebased/copy:$LD_LIBRARY_PATH

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

Sidebar

Related Questions

I built the opencl program using the commands: gcc -c -I ~/AMDAPP/include main.c -o
While running my make file which is as follows, ../bin/output : ../lib/libfun.a ../obj/main.o gcc
I have compiled my application on Linux (Intel) machine using this command gcc –g
Commands like sftp work in a way that it's not possible to pipe in
I am compiling from the command line with gcc -o output-file $(mysql_config --cflags) main.c
I have a make file that contains this code: all: main.o Etudiant.o gcc -lobjc
I have main.c, snmpy.c, snmpy.o, and a makefile. I running this on a Linux
I'm on gentoo linux with GCC 4.4.5 installed. I can compile and link such
There is a lib sources for linux with make scripts. http://svn.gna.org/svn/pokersource/branches/poker-eval-java/ . I need
Is there a set of command-line options that will convince gcc to produce a

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.