[uClinux-dev] 5208EVB m68k-uclinux/elf-gcc code size difference

David McCullough David_Mccullough at securecomputing.com
Wed Aug 15 08:15:22 EDT 2007


Jivin Martin Voss lays it down ...
> Hi,
> 
> Answering my own question:
> 
> > I'm a bit confused why the m68k-elf version uses the data section for
> an
> > uninitialized array? Should not the bss section be used for this? Or
> is
> > something broken in the m68k-uclinux toolchain I use?
> 
> Because the build scripts on the RH9 machine uses -fno-common which
> forces global variables to be initialized to all zeros. I did not use
> this switch on the SBCTools machine.
> 
> Are there any special reasons why this option is used in the build
> process of uClinux-dist for m68k targets?

-fno-common stops the linker from coalescing things with the same name
at link time.

For example,  I could do something like:

	file1.c:

		int my_tmp;

	file2.c:

		int my_tmp;

If file1.o and file2.o are linked into the same app,  then I end up with
one copy of my_tmp that is shared by both files.  -fno-common makes this
an error.

We had several bugs that prompted us to enable this,  we then found quite
a few more potential bugs once we enabled it.  I think all targets in the
dist use it by default.  All the apps have been cleaned up to build with
-fno-common for the combinations of libs/apps that we test.

Cheers,
Davidm

-- 
David McCullough,  david_mccullough at securecomputing.com,   Ph:+61 734352815
Secure Computing - SnapGear  http://www.uCdot.org http://www.cyberguard.com


More information about the uClinux-dev mailing list