Monday, November 19, 2001

Wrote a utility last night (based on foldelf.cpp) that reads a stream of addresses and converts them into function references. Surprisingly, it manages to find every function that gets called. (I was expecting BFD-like badness on ctors or static functions!) Anyway, this allowed me to collect some interesting info. If you add up the sizes for all of the symbols in the statically linked browser, you end up with just under 7MB of code (rounding each symbol's size up to the next power of four). If you add up the sizes for just those symbols used during startup, you end up with just over 2.5MB of code.

Still poking around with rogc's code re-ordering magic. He's got a perl script that generates a GNU linker script. The problem is that to use the linker script, you need to compile with -ffunction-sections, and this is incompatible with -pg which I use to collect address data. On the other hand, it looks like -finstrument-functions is compatible with -ffunction-sections, and that was the routine that I'd wanted to use anyway.