LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-15-2009, 01: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, 03:35 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
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, 05: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



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

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

All times are GMT -5. The time now is 10:18 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
Open Source Consulting | Domain Registration