Small footprint on Embedded system

Jeff Sturm jsturm@one-point.com
Tue Sep 24 17:21:00 GMT 2002


On 24 Sep 2002, Tom Tromey wrote:
> I thought the debug info didn't get mapped by ld.so.  Is that
> incorrect?

You're correct.  I changed topic slightly, though the OP talked about
size of .so files, which reminded me of it.

> Anyway, people are best advised to build without debug info for
> production use.  I assume that most OS packagers do this already (I
> haven't looked).

Well yes but... it's an annoyance that the .so and .a are so large when
bootstrapping gcc.  The extra debug info may also impact bootstrap times,
though I haven't measured.

Incidentally, I always preserve debug sections even in production, not
knowing when I might need to attach gdb to diagnose a problem in the
field.

> It would be nice if gdb could find the debug info in the .o files.
> Then we could simply omit it from the .so.  I imagine this is tricky,
> or it probably would have been implemented already.

The idea behind my little patch is that info for e.g. java.lang.Object is
emitted exactly once in libgcj.so rather than once per class.  That
shrinks libgcj.so enormously.  I'd think gdb could be taught to understand
that, though I never attempted it.

The g++ frontend makes considerable use of TYPE_DECL_SUPPRESS_DEBUG while
gcj currently emits everything for -g<n> where n > 1.

Jeff



More information about the Java mailing list