Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:28:17+00:00 2026-05-30T06:28:17+00:00

On Linux, I’m trying to strip a statically linked ELF file to the bare

  • 0

On Linux, I’m trying to strip a statically linked ELF file to the bare essentials. When I run:

strip --strip-unneeded foo

or

strip --strip-all foo

The resulting file still has a fat .notes section that appears to be full of funky strings.

Is the .notes section really needed or can I safely force it out with –remove-section?

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:28:19+00:00Added an answer on May 30, 2026 at 6:28 am

    From experience and from looking at the man page for strip, it looks like strip isn’t supposed to get rid of any and all sections and strings that aren’t needed; just symbols. Quoth the man page:

       GNU strip discards all symbols from object files objfile.
    

    That being said, from experience, strip, even without --strip-all, removes sections unneeded for loading, such as .symtab and .strtab, and you can, as you note, remove sections you want it with --remove-section.

    As an example of a .notes section, I took /bin/ls from my Ubuntu 11.10 64-bit box:

    $ readelf -Wn /bin/ls
    
    Notes at offset 0x00000254 with length 0x00000020:
      Owner                 Data size   Description
      GNU                  0x00000010   NT_GNU_ABI_TAG (ABI version tag)
        OS: Linux, ABI: 2.6.15
    
    Notes at offset 0x00000274 with length 0x00000024:
      Owner                 Data size   Description
      GNU                  0x00000014   NT_GNU_BUILD_ID (unique build ID bitstring)
        Build ID: 3e6f3159144281f709c3c5ffd41e376f53b47952
    

    That encompasses the .note.ABI-tag section and the .note.gnu.build-id section. It looks like they contain data that isn’t necessary to load the program, but also isn’t standard, and isn’t known by strip to not be necessary for the proper running of the program, since an ELF can have any number of additional “unknown” sections that aren’t safe to remove. So rather using a virtual whitelist (which would fail miserably), it uses a blacklist of sections that it knows it can get rid of, and does so.

    Short version: these sections don’t seem to be standard and could be used for various things, so strip can’t know it’s safe to remove them. But based on the info inside the one I took above, if it’s your own program, it’s almost certainly safe to remove it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Linux(Ubuntu) I am trying to run a tool and it is showing error
On Linux, I'm using supbprocess.Popen to run an app. The command line of that
using linux commands, I have a quoted csv file which I sorted by first
in linux to copy and paste a file we have cp command cp [OPTION]...
Linux binaries are usually dynamically linked to the core system library (libc). This keeps
In Linux, say I have the following file (e.g. conf.properties): HOST_URL=http://$HOSTNAME STD_CONFIG=http://$HOSTNAME/config USER_CONFIG=http://$HOSTNAME/config/$unconfigured I
In linux I want to run a gnome zenity progress bar window from PHP.
with linux command or perl , How to get all monday date for 2010
In linux server what is the command to list all the SSL certificate and
Linux: I want to list all the files in a directory and within its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.