Re: Question about core files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Holger Kiehl wrote:

> >> Most the time I compile my application without the -g option due to
> >> performance reasons.
> >
> > The -g switch has absolutely no effect upon performance. It simply
> > causes and additional section to be added to the resulting binary.
> > When the program is run normally (i.e. not under gdb), that section
> > won't be mapped. The only downside to -g is that it increases the size
> > of the file.
> 
> But when executing the program will it not read the whole binary which
> is much larger with debug information and so will take longer (just the
> first reading of the binary)?

No. Binaries aren't "read", they're mapped (with mmap); pages are read
into memory on demand. The loader only maps the sections which are
actually required, which doesn't include the debug sections.

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux