AIX Linker Question: Symbol and garbage removal at link time?

Wayne Long <wcl@risc.sps.mot.com>
1 Jul 1998 22:55:32 -0400

          From comp.compilers

Related articles
AIX Linker Question: Symbol and garbage removal at link time? wcl@risc.sps.mot.com (Wayne Long) (1998-07-01)
Re: AIX Linker Question: Symbol and garbage removal at link time? fjh@cs.mu.OZ.AU (1998-07-03)
| List of all articles for this month |

From: Wayne Long <wcl@risc.sps.mot.com>
Newsgroups: comp.compilers
Date: 1 Jul 1998 22:55:32 -0400
Organization: Deja News - The Leader in Internet Discussion
Keywords: linker, question, comment

I am in the process of splitting a single large C source code module
into manageable pieces. Before the split, the executable for this
code was about 250K in size.


A side-effect of the splitting process is that I now have many more
object modules to link together, with more global variables. I have
noticed that the AIX linker/binder is adding about 2K-3K of (???) to
the final executable for each new object module I create. So, without
adding a line of new code, the executable for this multiple-module
version is now 280K in size.


I had a recommendation to use the unix strip command to reduce the
executable size, which it did well. In fact, it reduced the size by
almost 100 Kbytes! That is quite a bit of what would appear to be
garbage, in the executable!


My question is, instead of using strip, aren't there options on the
AIX compiler to do the same thing? I am wondering why these options
aren't the default? I understand symbols can be included into the
executable for debug, but I didn't create the individual object
modules with the -g option (include debug info), and I didn't specify
the -g option during linking, so why should the linker keep so much
unused garbage in the final executable?


Please illuminate a novice programmer.


Wayne


For reference, this what the linker command line looks like:


    cc -O -L../rtpp/_lib -I. -I../om -DINCLUDE_PROTOS -DDEBUG=1 \
        tcload.o cmdline.o read_cfg.o runload.o \
        sram_init.o shmem_chk.o varparse.o logging.o reg_ops1.o chk_om_data.o \
      -bloadmap:map -lm -lnetbasic -o tcload
[It's probably putting in the symbol table. Most linkers have a strip
option, but unless you're 150% sure your program is bug free, I'd leave
the symbols in place. They don't slow the program down any. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.