Fedora Linux Support Community & Resources Center
  #1  
Old 17th September 2009, 11:46 AM
M4rc0's Avatar
M4rc0 Offline
Registered User
 
Join Date: Aug 2007
Location: Brasil
Posts: 471
linuxfedorafirefox
LD_PRELOAD cannot be preloaded

Hi,

I have a Fedora 11 x86_64 bit.
And I'm trying to run a bind_hack with wine through LD_PRELOAD and it's giving me:

Quote:
ERROR: ld.so: object '/tmp/bind_hack.so' from LD_PRELOAD cannot be preloaded: ignored.
This is the hack:
Code:
/* This file is ditributed under the GPLv2 */

#define _GNU_SOURCE

#include </usr/include/sys/socket.h>
#include </usr/include/sys/types.h>
#include </usr/include/netinet/in.h>
#include </usr/include/dlfcn.h>
#include </usr/include/string.h>

int (*real_bind)(int fd, const struct sockaddr* add, socklen_t len);

void _init(void) {
    real_bind = dlsym(RTLD_NEXT, "bind");
}

int bind(int fd, const struct sockaddr* addr, socklen_t len) {
    struct sockaddr_in* sa;

    if(addr->sa_family==AF_INET) {
        sa = (struct sockaddr_in*) addr;
        memset(&sa->sin_addr, 0, sizeof(sa->sin_addr));
    }
    return real_bind(fd, addr, len);
}

And this is how I'm compiling:
Code:
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32

For this error to happen, I believe it's trying to load the 64 bits libs somehow? when it should be loading the 32 bit.

Is there any problem with the code? Perhaps if I compile in a 32bit machine it will work?

Any suggestions?
Reply With Quote
Reply

Tags
ldpreload, preloaded

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR: ld.so: object '/etc/libcwait.so' from /etc/ld.so.preload cannot be preloaded ntrajesh Using Fedora 0 31st January 2008 07:47 PM
opera error: object 'libjava.so' from LD_PRELOAD cannot be preloaded wouterzzzzz Using Fedora 0 9th January 2007 08:59 AM


Current GMT-time: 20:56 (Monday, 20-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat