2

I've noticed that strip removes ELF sections, such as .symtab and .strtab, but is there a way to force it to remove the .shstrtab section as well? I already tried the -R option but it didn't work. Strip just exits as if nothing happened. The current strip version is 2.30

ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
Trey
  • 85
  • 8
  • 2
    Welcome to Unix&Linux SE! With a quick glance to `man strip`, the options `-R
    ` or `--remove-section=
    ` look promising. Did you already try them? If you did, did they not work, or were they unsuitable for some other reason?
    – telcoM May 20 '18 at 07:09
  • Please edit that information into your actual question, as it is rather important for understanding your problem. `strip --version` output could be useful too. These comments are not permanent and will be deleted after a while. – telcoM May 20 '18 at 07:18

1 Answers1

2

If you are using the standard ELF tools, the functionality you asked for is in the mcs program that is a hard link to strip..

Use:

mcs -d -n .shstrtab <object-file-name>

See: http://schillix.sourceforge.net/man/man1/mcs.1.html

schily
  • 18,806
  • 5
  • 38
  • 60