1.4. What's in My Program?

You have written five lines of C++, yet the size command says your program is over 12K bytes. What happened?

Answer: Your program has been linked with code from the ERC32 libraries. In addition to the application code, your five lines, the executable program contains the following:

The following command will give you a list of the object files that have been linked into your program.

$ erc-coff-gcc -o hello  hello.c -Wl,-t
/opt/gcc-erc32-1.7e/erc-coff/bin/ld: mode erc_ram
art0.o (/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/art0.o)
/tmp/ccEfQQUH1.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)printf.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)vsprintf.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)write.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)mblen.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)strlen.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)ctype.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libc.a)_dtoa.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libgcc.a)__divsi3.o
(/opt/gcc-erc32-1.7e/lib/gcc-lib/erc-coff/2.8.1/libgcc.a)__modsi3.o