Open drawkula opened 5 years ago
asize and astrip only work on object files, rather than on the linker output files. So you'll need to strip all your object files one at a time before linking. It's possible to tell the linker to strip the resulting file but it looks like the ack
driver doesn't have a way to pass that flag on to the linker --- that's worth having.
but it looks like the ack driver doesn't have a way to pass that flag on to the linker --- that's worth having.
I indeed looked into the man page for it... ;-)
Thanks for the fast answer!
Use ack -Rled-s
to tell the linker to strip the symbols.
$ ack -mlinux386 -O4 example.c -Rled-s -o example
$ file example
example: ELF 32-bit LSB executable, Intel 80386, version 1
$ nm example
nm: example: no section header table
Tools like anm, asize, astrip only work ack.out(5) files, which are .o before linking, or .out after linking. If you use ack -c.out
to stop the conversion to ELF, you can use the tools.
$ ack -mlinux386 -O4 example.c -c.out -o example.out
$ anm -n example.out
16 A - EINVAL
8048054 0 S (NULL)
8048054 0 - begtext
...
$ asize example.out
224+0+4+144 = 372 = 0x174
$ astrip example.out
$ ack -mlinux386 example.out -o example
$ file example
example: ELF 32-bit LSB executable, Intel 80386, version 1
$ nm example
nm: example: no section header table
How can I use
asize
andastrip
correctly? Or is using the GNUish variants indeed the right way to go?