delorie.com/archives/browse.cgi | search |
> P.S. GNU ld still links all *.o into the .EXE even if not used. I find > that annoying. I was wondering why removing a #define and recompiling > didn't shave any output size until I proved that. Hm I think not. Look at libc.a which have about 850kB this would produce much bigger helloworld.exe if all *.o from libc would be linked. I observed that if you use one or more functions from x.o then entire x.o is linked. But it doesn't matter if it's ar-packed in library (group of *.o in .a) or separated. I know -ffunction-sections - fdata-sections and use it on avr-gcc where I want spare every byte and it helps. It also should work for DJGPP but it would require to recompile libraries to utilize it. BTW readline and ncurses increased size of my program from ~100kB - > 190kB (after strip & UPX) it seems to me high cost for a command line history (I use only 2 functions readline and add_history). I also want to add my commands completion - it looks a bit complicated I'm looking for some simple examples. I though it would be enough to provide a pointer on string array and readline would complette it but it seems that I will have to write some functions for searching in array etc. and readline will call them.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |