Hi,
I would like to remove Debug Section (including STRTAB and SYMTAB) in ELF using Codewarrior compile options.
I set to Off for "Generate DWARF Information".
But, ELF still has STRTAB and SYMTAB sections.
Please let me know how to remove STRTAB and SYNTAB from ELF.
Can I use strip ccmd? If possible, let me know how to use it.
Codewarrior Version : Version 11.0
Thanks.
Hello, Stanish
Thanks for your kind reply.
I have a commercial program that removes .strtab and .symtab sections from elf files.
I think the program is similar to the strip program you recommended.
What I would like to know about this topic is if there is an option in the CodeWarrior preferences menu.
I'm trying to download the program (S32DS).
(There are some problems to download the program.. so I need to have some time.)
I will let you know the test results.
Thanks.
Hi Luke,
Thanks for your question. You can indeed control the Off for "Generate DWARF Information" but it leaves string and symbol table in place.
I'd suggest you to install S32DS for Power v2.1:
It contains set of binutils:
"C:\NXP\S32DS_Power_v2.1\S32DS\build_tools\powerpc-eabivle-4_9\bin"
And you can try to use strip utility with parameter -s:
C:\NXP\S32DS_Power_v2.1\S32DS\build_tools\powerpc-eabivle-4_9\bin>powerpc-eabivle-strip
Usage: powerpc-eabivle-strip <option(s)> in-file(s)
Removes symbols and sections from files
The options are:
-I --input-target=<bfdname> Assume input file is in format <bfdname>
-O --output-target=<bfdname> Create an output file in format <bfdname>
-F --target=<bfdname> Set both input and output format to <bfdname>
-p --preserve-dates Copy modified/access timestamps to the output
-D --enable-deterministic-archives
Produce deterministic output when stripping archives
-U --disable-deterministic-archives
Disable -D behavior (default)
-R --remove-section=<name> Also remove section <name> from the output
--remove-relocations <name> Remove relocations from section <name>
-s --strip-all Remove all symbol and relocation information
-g -S -d --strip-debug Remove all debugging symbols & sections
--strip-dwo Remove all DWO sections
--strip-unneeded Remove all symbols not needed by relocations
--only-keep-debug Strip everything but the debug information
I tried to precess CodeWarrior generated elf for MPC56xx and it seems the sections are not present any more but I lost the ability to dissasemble the resulted elf.
Could you try on your side if the final elf is still usable(loadable) for you? if not please consider to distribute a binary file e.g. s-record instead if .elf
This step yould be easily automated by adding strip into postbuild steps:
hope it helps.
Stan