AROS Exec
Development => Development (General) => Topic started by: el-topo on January 29, 2020, 02:32:01 PM
-
Hi folks!
I just installed Icaros Desktop on an i386 native machine and started to play around with gcc compiling "Hello World". I'm used to use the strip program to reduce the size of my binaries when I compile on Linux but when I tried it in AROS I get an error saying that there's not enough memory. The binary worked fine before stripping it (and with the -s option to gcc) so it seems strip removes something that's essential for the binary to run. Any idea what's up and if there's any remedy for this?
-
That's a quirk with ABI v0. That has been fixed in ABI v1.
-
Options "-s" removed all symbol and relocation information, then it cannot work. You try the options "-S" remove all symbols not needed by relocations.
-
That's a quirk with ABI v0. That has been fixed in ABI v1.
Aha, that explains it. A problem that will pass with time then :)
-
Here's another alternative, that might help.
strip myprogram --strip-unneeded --remove-section .comment
-
Here's another alternative, that might help.
strip myprogram --strip-unneeded --remove-section .comment
Yes it does! Many thanks for posting this solution. Here is a comparison on the size of some hello world compiles:
test-stripped 7332 ---rwed Today 10:56:29
test-s 7720 ---rwed Today 10:54:31
test-vanilla 9279 ---rwed Today 10:54:17
test-s is what you get using gcc -s. With such a small program there's not a huge difference, but I suppose the benefit will be much bigger as the source code grows.