OT: Why -g when compiling

Michael Hudson mwh at python.net
Fri Dec 26 05:36:14 EST 2003


"Martin v. Löwis" <martin at v.loewis.de> writes:

> Michael Hudson wrote:
> 
> > True.  I don't know if the various linkers around are smart enough to
> > not load debugging information until it's asked for...
> 
> Atleast on Unix, not mapping debug information at run time has a long
> tradition. In ELF, each section has a LOAD flag indicating whether
> a section needs to be mapped or not. So the ELF dynamic loader does
> not specifically know to omit debug information, but only loads
> sections that the static linker told it to.

That makes sense.  I also guess that as shared libraries are mmaped
into the applications address space they won't use physical memory
until referenced anyway.  But relocations probably mess with that.

Cheers,
mwh

-- 
  The ultimate laziness is not using Perl.  That saves you so much
  work you wouldn't believe it if you had never tried it.
                                        -- Erik Naggum, comp.lang.lisp




More information about the Python-list mailing list