[Prism54-devel] New FreeMAC snapshot
Denis Vlasenko
vda at ilport.com.ua
Mon Oct 3 09:09:13 UTC 2005
Hi Seb,
> > 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
After little objdumping I found out that it's just a bss
being put in wrong place. With this freemac.lds:
OUTPUT_ARCH(arm)
ENTRY(head)
SECTIONS {
.text : {
boot.o(.text)
*(.text)
*(.rodata*)
. = ALIGN(4);
}
.data : {
*(.data*)
. = ALIGN(4);
}
.bss : {
*(.bss*)
. = ALIGN(4);
}
}
I am getting the smallest image:
-rwxr-xr-x 1 root root 7484 Oct 3 12:05 freemac.arm
(BTW... do we zero out bss as we should?)
--
vda
More information about the Prism54-devel
mailing list