LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-15-2009, 02:33 AM   #1
gbhat
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Rep: Reputation: 0
What is the format of .dynstr section of ELF?


Is there any specification defines what is the format of the .dynstr section of dynamic linked ELF file? I found different format with different compilers for example,



In case of armlink -- all *.so files are listed together like..

test.so
test1.so
symbol1_test
symbol2_test
symbol1_test1
symbol2_test1

But, in case of gnuld, the associated symbols and *.so file
names are clubbed together.

test.so
symbol1_test
symbol2_test
test1.so
symbol1_test1
symbol2_test2

///G
 
Old 07-16-2009, 04:35 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 675

Rep: Reputation: 136Reputation: 136
Quote:
Originally Posted by gbhat View Post
Is there any specification defines what is the format of the .dynstr section of dynamic linked ELF file? I found different format with different compilers for example,



In case of armlink -- all *.so files are listed together like..

test.so
test1.so
symbol1_test
symbol2_test
symbol1_test1
symbol2_test1

But, in case of gnuld, the associated symbols and *.so file
names are clubbed together.

test.so
symbol1_test
symbol2_test
test1.so
symbol1_test1
symbol2_test2

///G
dysnstr is just "vocabulary" of 0-terminated strings. Those strings referenced from another places. So what you see is not "different format" - it's just different strings sequence

As long as I know ELF specification doesn't impose any specific order on the strings in the dynstr section.

Why the order of strings in dynstr section is important for you, what you aure trying to achieve ?
 
Old 07-17-2009, 06:27 AM   #3
gbhat
LQ Newbie
 
Registered: Jun 2009
Posts: 2

Original Poster
Rep: Reputation: 0
When I wrote a dll manager, I found a way to get the name of the dynamic shared object (*.so) from .dynstr section traversing back on the string table looking for .so extension (It was working, in case of GNU LD, where the *.so and associated symbols are together).
The idea something like direct library binding and quick on resolving the symbol address. Instead of parsing all DSO files from DT_NEEDED every time to resolve a symbol address.

But this didn't work with armlink generated elf file, where it failed because all the *.so files where together.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - Hardware 1 05-11-2007 06:32 PM
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - General 1 05-11-2007 04:44 PM
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - Software 1 05-11-2007 04:31 PM


All times are GMT -5. The time now is 06:56 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration