473,395 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

getting symbol information from elf binary

Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.

My question is that, I want to retrieve the information about all
structures from an elf binary. For eg. suppose I use a structure of
some type in my C program and then I compile it to get the elf binary.
Now, can I get the information about that structure (names of all the
fields used in that structure, their type etc) from the elf binary. I
believe this is possible with the COFF binary but I didn't find any
section in ELF binary that keeps this information.

If anyone knows any way, please let me know.

thakns a lot for any hint ....

Jul 19 '07 #1
8 3116
On Thursday 19 Jul 2007 11:11 am, ju**********@yahoo.co.in
<ju**********@yahoo.co.inwrote in message
<11**********************@m37g2000prh.googlegroups .com>:
Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.

My question is that, I want to retrieve the information about all
structures from an elf binary. For eg. suppose I use a structure of
some type in my C program and then I compile it to get the elf
binary. Now, can I get the information about that structure (names
of all the fields used in that structure, their type etc) from the
elf binary. I believe this is possible with the COFF binary but I
didn't find any section in ELF binary that keeps this information.

If anyone knows any way, please let me know.

thakns a lot for any hint ....
This is possible if you compile your binary with debugging
information. Of course, your program needs to know in exquisite
detail, the format of ELF binaries, as well as the debugging format.

The first job is a *big* one and it's already been done. No need to
duplicate it. Just use the GNU Binary File Descriptor (libbfd),
library. The second job is simpler, particularly if you confine
yourself to only one debugging format.

The job is certainly possible but is a fair amount of work, and in
the general case, a lot of work. Isn't there a way for you to use
something like GDB for this? Or even use the compiler itself?

Anyway, for more details you need to ask in a group specific for your
system. Also the gnu groups might be helpful. Unless the C code is
Standard C, or any non-Standard functions are fully defined, it's
probably better to ask in a more specific group.
Jul 19 '07 #2
In article <11**********************@m37g2000prh.googlegroups .com>,
ju**********@yahoo.co.in <ju**********@yahoo.co.inwrote:
>Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.
As good a job as you have done of trying to sweettalk us and get on our
good side, there is still only one possible answer to this posting.
And, of course, it is the usual:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

Useful clc-related links:
--
http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

Jul 19 '07 #3
On Thursday 19 Jul 2007 7:55 pm, Kenny McCormack
<ga*****@xmission.xmission.comwrote in message
<f7**********@news.xmission.com>:
In article <11**********************@m37g2000prh.googlegroups .com>,
ju**********@yahoo.co.in <ju**********@yahoo.co.inwrote:
>>Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.

As good a job as you have done of trying to sweettalk us and get on
our good side, there is still only one possible answer to this
posting. And, of course, it is the usual:

Off topic.
Yes, because Standard C has no built-in knowledge of ELF or debugging
formats.
Not portable.
I think that a program such as what the OP wants *can* be written in
Standard C; it's just that the knowledge required to write it is not
a part of the C Standard, or even the C language.

<snip>
Jul 19 '07 #4
"ju**********@yahoo.co.in" <ju**********@yahoo.co.inwrites:
Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.

My question is that, I want to retrieve the information about all
structures from an elf binary. For eg. suppose I use a structure of
some type in my C program and then I compile it to get the elf binary.
Now, can I get the information about that structure (names of all the
fields used in that structure, their type etc) from the elf binary. I
believe this is possible with the COFF binary but I didn't find any
section in ELF binary that keeps this information.

If anyone knows any way, please let me know.

thakns a lot for any hint ....
see ...

https://ols2006.108.redhat.com/2007/...lo-Reprint.pdf

Chip
Jul 19 '07 #5
In article <f7**********@aioe.org>, santosh <sa*********@gmail.comwrote:
>On Thursday 19 Jul 2007 7:55 pm, Kenny McCormack
<ga*****@xmission.xmission.comwrote in message
<f7**********@news.xmission.com>:
>In article <11**********************@m37g2000prh.googlegroups .com>,
ju**********@yahoo.co.in <ju**********@yahoo.co.inwrote:
>>>Guys,

I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.

As good a job as you have done of trying to sweettalk us and get on
our good side, there is still only one possible answer to this
posting. And, of course, it is the usual:

Off topic.

Yes, because Standard C has no built-in knowledge of ELF or debugging
formats.
>Not portable.

I think that a program such as what the OP wants *can* be written in
Standard C; it's just that the knowledge required to write it is not
a part of the C Standard, or even the C language.
OK. So, we're all on the same page. Good to know.

Jul 19 '07 #6
On Wed, 18 Jul 2007 22:41:35 -0700, in comp.lang.c ,
"ju**********@yahoo.co.in" <ju**********@yahoo.co.inwrote:
>My question is that, I want to retrieve the information about all
structures from an elf binary.
I presume an elf binary is some sort of machine specific library
format. Did you try comp.unix.programmer?
>believe this is possible with the COFF binary but I didn't find any
section in ELF binary that keeps this information.
Its entirely possible that the binary does NOT retain this info. Linux
people wuold probably know....
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 19 '07 #7
Mark McIntyre <ma**********@spamcop.netwrites:
On Wed, 18 Jul 2007 22:41:35 -0700, in comp.lang.c ,
"ju**********@yahoo.co.in" <ju**********@yahoo.co.inwrote:
>>My question is that, I want to retrieve the information about all
structures from an elf binary.

I presume an elf binary is some sort of machine specific library
format. Did you try comp.unix.programmer?
>>believe this is possible with the COFF binary but I didn't find any
section in ELF binary that keeps this information.

Its entirely possible that the binary does NOT retain this info. Linux
people wuold probably know....
To the OP : if you are using Linux look up the elfutils package. IN
particular eu-nm which lists symbols in the binary.
Jul 20 '07 #8
On Jul 19, 8:54 pm, Chip Coldwell <coldw...@gmail.invalidwrote:
"junky_fel...@yahoo.co.in" <junky_fel...@yahoo.co.inwrites:
Guys,
I am extremely sorry for posting a question that is not
related to C. I tried my best to get some information from web but
failed. I would be highly grateful if someone could provide me some
hint or direct me to some useful link.
My question is that, I want to retrieve the information about all
structures from an elf binary. For eg. suppose I use a structure of
some type in my C program and then I compile it to get the elf binary.
Now, can I get the information about that structure (names of all the
fields used in that structure, their type etc) from the elf binary. I
believe this is possible with the COFF binary but I didn't find any
section in ELF binary that keeps this information.
If anyone knows any way, please let me know.
thakns a lot for any hint ....

see ...

https://ols2006.108.redhat.com/2007/...lo-Reprint.pdf
Thanks Chip, for the link. This was really useful.

Jul 23 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Developer98115 | last post by:
I need help getting schema information from an existing SQL Server database. My thought was that you could use ADOX via InterOp. Has anyone done this successfully and how? I have created a...
1
by: dixie | last post by:
If I have a query that returns say, 3 records sorted by date, so that the latest record is at the bottom of the list, can I then use just the information from that last record to put onto an...
0
by: z. f. | last post by:
Hi, i have asp.net vb.net wep application. i try to investigate performance issue. so first i built a vb.net windows application that makes http requests to my pages and show me the time taken...
1
by: z. f. | last post by:
Hi, i have a asp.net vb.net web appliation. it is compiled to release build with debug information. i have module to analyze errors in application_onError to trap all errors in my code and...
4
by: dirtside | last post by:
I've search far and wide for an answer, so forgive me if this is a stupid question. (Well, it probably is.) Consider the following JavaScript: var foo = new Image(); foo.src =...
4
by: herc | last post by:
My objective is to get the "label" information for the different volumes that are mounted. I want to display the same information as Windows Explorer. I wrote this test code with gets me the...
2
by: =?Utf-8?B?TWFyYw==?= | last post by:
In Visual Studio 2005, I am developing a Windows Mobile application, using Mobile SQL 2005. I need Data from a Database to be shown in a DataGrid, this works. But now I want to be able to get the...
2
by: Chuck Anderson | last post by:
I am trying to use ImageMagick to create thumbnails on the fly - without having to save the image to a file. I have gotten it to work by using passthru($cmd, $retval), but I want to use...
1
by: Mufasa | last post by:
I'm trying to modify my exception handler to give me as much useful information as possible. One of the thigs I would like to know is where in the code the error actually happened. I can print out...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.