I am writing a small hello world shared library. I am using the guide on
ucdot.org
(http://www.ucdot.org/article.pl?sid=03/11/25/1126257&mode=thread).
Following the instructions, I am able to generated a "libshtest"
executable. Unfortunately, it is just over 32 MB in size. I've
determined that it's directly related to the -mid-shared-id value I pass
during the link. When I set the id to 1, it drops to 16 MB in size.

My libshtest is only 902 bytes. Most of the space inside of the 32MB
libshtest is '00'.

Here's my compile strings.
        m68k-elf-gcc -mid-shared-library -mshared-library-id=2 \
        -m5307 -DCONFIG_COLDFIRE -Os \
        -fomit-frame-pointer -fno-common -fno-builtin -Wall \
        -DEMBED -Dlinux -D__linux__ -Dunix -D__uClinux__ \
        -c -o shared_lib.o shared_lib.c
        # Build shared library (old toolchain method)
        ar -r libshtest.a shared_lib.o
        m68k-elf-gcc -nostartfiles -o libshtest                 \
        -m5307 -DCONFIG_COLDFIRE -O2                            \
        -fomit-frame-pointer -fno-common -fno-builtin -Wall     \
        -DEMBED -mid-shared-library                             \
        -Wl,-elf2flt -nostdlib -Wl,-shared-lib-id,2             \
        $(ROOTDIR)/uClibc/lib/main.o                            \
        -Wl,--whole-archive,libshtest.a,--no-whole-archive

I am using the new Codesourcery 4.1 toolchain with linux-2.4.x on GCC.

- Jate S.
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to