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

2
  • 2
    Welcome to Unix&Linux SE! With a quick glance to man strip, the options -R <section name> or --remove-section=<section name> look promising. Did you already try them? If you did, did they not work, or were they unsuitable for some other reason? Commented May 20, 2018 at 7: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. Commented May 20, 2018 at 7:18

1 Answer 1

2
+25

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.