LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2006, 05:07 AM   #1
unclesam
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
Is it madatory for a executable file to have relocation section ?


Hi

I have a problem in finding a symbol in shared object . When i convert a dll made on windows to the shared object on linux . Also i have a application which i have converted in elf format but it is running properly if it is without any dependency on the user created dll . When an application depending on the user created dll on windows is converted into elf format then on executing it on linux it gives an error that ->



undefined symbol fopen_api eg,) this symbol is defined in the dll which has been converted to shared object . So when the elf file using that shared object on linux is executed the given error comes.



Although the executable gets shared library but it does not execute because on readelf it shows the dependencies and also the export information is also present in the shared object.



What might be the reason?

Also after error , segmentation fault occurs and program exits .

How can i debug the program without having debug section in my converted format of executable ?


Can anybody out there help me ?
 
Old 01-31-2006, 10:07 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
A statically linked file shouldn't have a relocation section since no external libraries have to be mapped in (I'm not 100% sure on this, but it makes sense and a quick test I ran seems to confirm it).

How are you converting your dll? Are you recompiling with gcc -shared to make the library? It sounds like either the library hasn't been created correctly or the loader isn't picking it up. This could be because it is not in your LD_LIBRARY_PATH or /etc/ld.so.conf, which govern the directories in which ld looks for shared libraries. Try setting the LD_LIBRARY_PATH to point to the directory with your library. You can run ldd <executable> yto get a list of the shared libs an executable depends on -- if any are not found, chances are the executable will fail in the manner you describe.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LILO L 99 99 99... again. Physical relocation of file? dodgecharger Linux - General 1 10-18-2004 07:51 PM
Madatory Auto Logoff and shutdown wanted 1kyle Linux - Security 1 07-17-2004 02:19 PM
relocation error - glibc - file ld-linux.so.2? gjhicks Linux - Software 1 07-04-2004 10:06 AM
Linux Executable File Help (created from a .c file) MattG1981 Linux - Newbie 7 06-06-2004 04:54 PM
RPM Spec file creation: %file section question davidas Linux - Newbie 0 03-16-2004 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration