|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
LD_PRELOAD on x86_64 gives error from ld.so
I have implemented an interposer for open() and open64() system call.
This interposer is implemented in interposer.c and I have compiled it in a shared library (libinterposer.so) using the following commands: gcc -g -fPIC -s -o interposer.o -c interposer.c gcc -s -g -shared -nostartfiles -o libinterposer.so interposer.o -ldl This interposer is working on i686 architecture. When I say working, it means, I can set the LD_PRELOAD environment variable to 'libinterposer.so' and intercept all 'open' system calls. However when I repeat the exact same steps on a x86_64, I get errors from ld.so like so: manmukhe@sjc-lds-133:[lbt]echo $LD_PRELOAD libinterposer.x86_64.so manmukhe@sjc-lds-133:[lbt]touch x.c ERROR: ld.so: object 'libinterposer.x86_64.so' from LD_PRELOAD cannot be preloaded: ignored. The file types for libinterposer.so and touch are as follows: manmukhe@sjc-lds-133:[lbt]file libinterposer.x86_64.so libinterposer.x86_64.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), stripped manmukhe@sjc-lds-133:[lbt]file /bin/touch /bin/touch: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped Here are my questions: 1. What am I doing wrong? Why am I getting the ld.so error? 2. Is there any way to suppress the ld.so errors? |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Declaring LD_PRELOAD system wide for dynamic loading | mzeeshan | UNIX for Advanced & Expert Users | 0 | 07-24-2009 04:27 AM |
| Preloading libraries.. LD_PRELOAD | manchester | UNIX for Advanced & Expert Users | 3 | 02-19-2009 07:15 AM |
| What does LD_PRELOAD signify? | shriashishpatil | UNIX for Advanced & Expert Users | 4 | 02-02-2009 10:22 AM |
| LD_PRELOAD on HP UX? | psreddy1234 | HP-UX | 2 | 11-10-2008 04:30 AM |
| confused X86_64 and AIX | eternalflame | Linux | 2 | 04-03-2008 04:21 AM |
|
|