change the memory address of ld.linux-so in a dynamically linked process


 
Thread Tools Search this Thread
Operating Systems Linux change the memory address of ld.linux-so in a dynamically linked process
# 1  
Old 12-25-2009
change the memory address of ld.linux-so in a dynamically linked process

hi,
For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process.
And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to change it address into "0x40000000", and use the "gcc -specs" to choose the new "ld-linux.so.2" as my default interpreter, the the program is compiled and when I use "ldd" I can see the "ld-linux.so.2" is put at "0x4000000" , but when I run the process, it crashed? I find it crash at "_dl_bebug_initialize()" , which access a not exist memory address, "0x008294e0" , I think it is the "got" in the former image.
so is there any solution? Thanks a lot!


ps :
Though I have update the gcc specs to choose the new "ld-linux.so.2" as my default interpreter, how can I choose other libraries, such as "libc.so.6" and "libgcc_s.so.1".
# 2  
Old 12-26-2009
This does not make a whole lot of sense to me. What is your 'special reason'?

You want use dld to load external references with a predefined address in shared memory? Is that what you mean?

Here is why I ask: we get unusual requests for things, things for which the requester has already decided 'how to do it'. What are you trying to do? We don't want to know how you think it ought to be done - just please tell us what you need.
# 3  
Old 12-26-2009
Are you trying to speed up application startup? Create a partially linked application?
# 4  
Old 12-26-2009
Actually, I'd like to manage the memory space of a process. We develop a process level virtual machine, which could run different binary code( MIPS , SPARC, ..) on different platforms( IA-32...). So I wish I could allocate all the low memory space ( 0~1G) to the guest process(e.g , the entry of a normal mips process begins at 0x004001a0). While the default memory address allocated for ld-linux.so is at 0x0082100, so I'd like to move it to another place, same to another shared libraries.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to change allocated memory for a process?

Hello, I am running ubuntu 14.04 in a server with 32GB ram. Due to receiving "high load" errors during ssh connection, I took a look at what's happening from command line. I detected that 20GB of total memory was allocated to a program. Below you can see some initial part of installation... (4 Replies)
Discussion started by: baris35
4 Replies

2. UNIX for Beginners Questions & Answers

How to make a dynamically linked executable file?

So I have a file called queens.cc and I need to do the following: Compile and make a .o file while specifying that the compiler is to search /student/214/include for system include files. Use g++, link and load .o file to make a dynamically linked executable file called queens and to also... (1 Reply)
Discussion started by: steezuschrist96
1 Replies

3. UNIX for Advanced & Expert Users

What is the function to get address of the virtual memory block in linux??

I want address of current virtual memory block? i am using fedora10:wall::wall: (1 Reply)
Discussion started by: powyama
1 Replies

4. Programming

shared memory with linked list??

is this possible, if so plz please share with me.. Correct English please, not Cyber-/Leetspeak (11 Replies)
Discussion started by: vijay_manpage
11 Replies

5. UNIX for Dummies Questions & Answers

How to attach a linked list to the shared memory?

Hi all, I have been working on shared memory. I have created the shared memory and a linked list of 5 nodes. Now I want to attach the linked list to shared memory. When we attach a shared memory it returns a void pointer, but here I am in a fix , how to relate this void pointer to linked list.... (1 Reply)
Discussion started by: jimmyuk
1 Replies

6. UNIX for Dummies Questions & Answers

change the memory address of ld.linux-so in a dynamically linked process

hi, For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process. And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to change... (0 Replies)
Discussion started by: zerocool_08
0 Replies

7. UNIX for Advanced & Expert Users

process memory change in unix

Hello! I was wondering if I could trouble all your experts with a couple questions regarding checking memory usage changes during the run time in the specific program (process) under UNIX. 1. After the program starts running, is ps the best way to tell the total memory usage at the any time? ... (2 Replies)
Discussion started by: aginger
2 Replies

8. Programming

setuid bit on user + dynamically linked libraries

hi all, i have a critical and specific problem with respect to set uid bit on user and the dll's for a binary, (under the userid A) it needs libraries from /usr/lib and informix libraries from $INFORMIXDIR/lib/esql but this binary should be kicked off from id B, hence s-bit on user is... (5 Replies)
Discussion started by: matrixmadhan
5 Replies

9. UNIX for Advanced & Expert Users

dynamically linked file

Hi friends, i have a dynamically linked file on my solaris system.this is script that runs regularly. How can i read the contents of that ? when i tried to say "vi filename " then it says executable and nothing is seen. Please help. thanks in advance Veera (5 Replies)
Discussion started by: sveera
5 Replies

10. Shell Programming and Scripting

dynamically linked file

Hi friends , how do i view a dynamically linked file in unix ? its there on other system and do i have to ftp it in ASCII format or binary ? and after the ftp how do i view it ? thanks in advance veeras (1 Reply)
Discussion started by: sveera
1 Replies
Login or Register to Ask a Question