Mail Archives: djgpp/1998/01/20/14:16:45
On 19 Jan 98, Scarius was found to have commented thusly:
> Jochen Erwied wrote:
>
> > It removes the linked-in symbols of your program. Same effect as if you link
> > your program with 'gcc -s -o <program> ...'
>
> I'm just dumb, but what does that mean? As I understand compiling
> (been working on some simple compilers of my own), there wouldn't be
> any symbols left in the finished, compiled program. Maybe I just
> don't understand. Thx
There would be symbols--variable names, identifiers-left in
(appended to) object code if you wanted to do source-level debugging.
The Unix utility sdb (Symbolic DeBugger) is a prime example. It
requires that object code be compiled with symbol references in order
to debug code at the source level. Its GNU equivalent is gdb. The
Borland IDE equivalent in the DJGPP distribution is RHide.
The C compiler (cc, gcc, tcc <--Borland's) needs to be told to
include symbolic information for debugging operations in which you
want to include your source. Generally you flag the compiler by
passing it the option '-g' to tell it to include the symbols. The
default is generally NOT to include symbols for source-level
debugging in the object code.
If you use the C compiler/linker only to link your objects to form an
executable in which the objects have already been compiled
and include the extra debugging information, then you would use the
command line given above for 'gcc' simultaneously to 'strip' away the
debugging info and to link it. The '-s' option is on the command
line as the programmer may be assuming--or wants to make sure--that
no debugging information is included.
Now the question for developers of gcc is, what is the object file
format of code that includes symbol references? How are external
references (global variables, functions), static variables (both in
file and block scope), and automatic variables (locals) organized for
use by the debugger?
Mitch Halloran
Research (Bio)chemist
Duzen Laboratories Group
Ankara TURKEY
mitch AT duzen DOT com DOT tr
other job title: Sequoia's (dob 12-20-95) daddy
- Raw text -