LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 09-29-2008, 03:56 AM   #1
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Rep: Reputation: 32
objdump doubt!!!!!


Hello,

Days ago, when I develop my programm, I used objdump to watch address of some vars, but now, I can not use objdump because I have a problem:

GNU objdump (GNU Binutils; openSUSE 11.0) 2.18.50.20080409-11.1

Quote:
objdump -g popi
popi: file format elf32-i386
objdump: popi: no recognized debugging information
Quote:
objdump -e popi
objdump: popi: no recognized debugging information
Could somebody tell me what is the reason of this???
I do not understand it.

Best reagards

Last edited by webquinty; 09-29-2008 at 04:50 AM.
 
Old 09-29-2008, 08:07 AM   #2
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Original Poster
Rep: Reputation: 32
Hello,

Well I find this tool, OBJCOPY, but I not sure how to use it.
Can this tool help me to translate my file in other format to extract debugging information???

I am newbie.

Best reagards
 
Old 09-29-2008, 08:30 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
If you use gcc, did you compile with the "-g" flag to produce debugging information?
 
Old 09-29-2008, 09:49 AM   #4
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Original Poster
Rep: Reputation: 32
hello,

Of course, I use -g or -ggdb flag when I compile my task.
Days ago I did it without problem, but now I do not known what happen.
For example, one of my examples:

Quote:
gcc -g -c -Wall captain/capser.c -o capser.o
gcc -g -c -Wall ser.c -o ser.o
gcc -g ser.o capser.o -o ser
Quote:
objdump -g ser
ser: file format elf32-i386
objdump: ser: no recognized debugging information
but it does not work.

Best regards

Last edited by webquinty; 09-29-2008 at 10:03 AM.
 
Old 09-29-2008, 05:14 PM   #5
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
That's strange. Did you upgrade any packages? Can readelf provide you with the same information you need from objdump?

I've just tried objdump on a "hello world" program and got the same results (no recognized debugging info). I'll have to look into this sometime; the information is definitely there (and I don't see a use for objdump if it can't print out what it's meant to).
 
Old 09-30-2008, 03:25 AM   #6
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Original Poster
Rep: Reputation: 32
Thanks a lot pinniped,

I have made a "hello programm" and.....

hello.c
Quote:
#include <stdio.h>
#include <stdlib.h>

unsigned int value;

int main(void) {
value = 0;
printf("hello, world");
return(0);
}
...compile test programm....
Quote:
gcc -g -O2 hello.c -o hello
Output of objdump...
Quote:
objdump -g hello
hello: file format elf32-i386
objdump: hello: no recognized debugging information
The same problem, but If I use readelf, it works fine and it give me the information that I need it.

readelf -s hello

Quote:
Symbol table '.dynsym' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
2: 00000000 441 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.0 (2)
3: 00000000 54 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.0 (2)
4: 080484dc 4 OBJECT GLOBAL DEFAULT 16 _IO_stdin_used

Symbol table '.symtab' contains 78 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 08048134 0 SECTION LOCAL DEFAULT 1
2: 08048148 0 SECTION LOCAL DEFAULT 2
........
........
........
71: 0804a01c 4 OBJECT GLOBAL DEFAULT 25 value
Well, I will try to find what is the reason that objdump does not work properly now. Perhaps I upgrade some package, I not sure.

Any way, at the moment, this is enought for me, nut READELF do not show me type of var.

Thank you very much pinniped.

Best regards

Last edited by webquinty; 09-30-2008 at 08:21 AM.
 
Old 09-30-2008, 09:03 AM   #7
webquinty
Member
 
Registered: Apr 2008
Location: Espaņa
Distribution: Suse
Posts: 218

Original Poster
Rep: Reputation: 32
Well,

I have found some information in the net about the same problem.

Quote:
When trying to get the debugging information of binaries,
"objdump -g" still fails as of binutils=2.18-1.

Using "gcc -gstabs a.c -o a.out" makes objdump work again ... so
just the dwarf format is not recognized any more?
I have the same question, the dwarf format is not recognized any more?

Best regards.

Last edited by webquinty; 09-30-2008 at 09:08 AM.
 
  


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
readelf and objdump andyzn Programming 1 12-06-2007 06:08 AM
when objdump is applied on vmlinux topworld Linux - Software 0 03-31-2006 02:05 AM
contents of vtable and objdump utilty krsnachaitanya Programming 2 02-11-2005 08:57 PM
objdump usage cranium2004 Linux - Newbie 0 01-20-2005 02:00 AM
Using objdump for decompiling JIV Programming 0 06-13-2004 09:33 AM


All times are GMT -5. The time now is 10:42 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