Do you really need an ELF.notes section?

On Linux, I'm trying to split a statically linked ELF file into simple things. When I run:

strip --strip-unneeded foo

or

strip --strip-all foo

There is still a section of fat.notes in the resulting file, which appears to be full of funky lines.

Do I really need a .notes section, or can I safely disconnect it with --remove-section?

Thanks for any help.

+5
source share
1 answer

From the experience and searching of the man page for strip, it seems that stripI should not get rid of any sections and lines that are not needed; just characters. Enter the manual page:

   GNU strip discards all symbols from object files objfile.

, strip, --strip-all, , .symtab .strtab, , , , --remove-section.

.notes /bin/ls 64- Ubuntu 11.10:

$ 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

.note.ABI-tag .note.gnu.build-id. , , , strip, , ELF "" , . , ( ), , , , , .

: , strip . , , , .

+6

All Articles