[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to tell whether .o was compiled with -g option
From: |
Henrik Carlqvist |
Subject: |
Re: How to tell whether .o was compiled with -g option |
Date: |
Tue, 22 May 2007 08:31:46 +0200 |
User-agent: |
Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) |
karl@freefriends.org (Karl Berry) wrote:
> I'm sure this is not 100% accurate (in either direction), but it's one
> hint, anyway.
I was also going to give this answer, but did a quick test first:
$ gcc -g -c -o hello_debug.o hello.c
$ gcc -c -o hello_no_debug.o hello.c
$ ls -al *.o
-rw-r--r-- 1 henca users 9056 May 22 08:24 hello_debug.o
-rw-r--r-- 1 henca users 776 May 22 08:25 hello_no_debug.o
$ file *.o
hello_debug.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(SYSV), not stripped
hello_no_debug.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(SYSV), not stripped
$ strip *.o $ ls -al *.o
-rw-r--r-- 1 henca users 496 May 22 08:25 hello_debug.o
-rw-r--r-- 1 henca users 496 May 22 08:25 hello_no_debug.o
$ file *.o
hello_debug.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(SYSV), stripped
hello_no_debug.o: ELF 32-bit LSB relocatable, Intel 80386, version 1
(SYSV), stripped
So, there is more than the debug information that gets stripped out from
an object file and being "not stripped" is no guarantee for containing
debug information.
Unfortunately I have no better answer.
regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc1(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost