[Prism54-devel] New FreeMAC snapshot

Denis Vlasenko vda at ilport.com.ua
Mon Oct 3 06:48:23 UTC 2005


On Sunday 02 October 2005 19:08, Sebastien wrote:
> > > By the way, it's no use to add "#ifdef UNUSED" around functions
> > > that are never called : the compiler automatically strips them off
> > > the resulting binary, AFAIK.
> >
> > You overestimate cleverness of ld.
> 
> Even Turbo Pascal 7 for DOS does this automatically... ld sucks a bit.

TP7 had a custom object file format and linker. Great for speed
and optimization tricks, but loses on interoperability with other
languages/compilers.

> However, after some searches on the web, I found a hack to strip dead 
> code with GNU ld. I have committed the modified version. Can you check 
> it still works with your PCI card, since I had to modify the linker 
> script?

Just downloaded, unmodified tarball:
-rwxr-xr-x  1 root root 11852 Oct  3 09:33 freemac.arm

I added bogus call to sscanf, requiring sscanf to be linked in:
-rwxr-xr-x  1 root root 13424 Oct  3 09:35 freemac.arm

So it really works.

However, if I replace Makefile and freemac.lds by ones from
older tarball, I get smaller image:
-rwxr-xr-x  1 root root  9524 Oct  3 09:41 freemac.arm

And when I also completely #ifdef out sscanf from libc.c:
-rwxr-xr-x  1 root root  8216 Oct  3 09:44 freemac.arm
 
> BTW, has anyone managed to get -mcpu=arm946e (as we should use) to work 
> with GNU toolchain ? Mine complains about an unsupported -mcpu flag, 

For me: as can take it, but not gcc.

> although it should be supported according to the documentation.
--
vda


More information about the Prism54-devel mailing list