STRIP(1) Strumenti di sviluppo GNU STRIP(1)

strip - Scarta i simboli dai file oggetto.

strip [-F bfdname |--target=bfdname]
[-I bfdname |--input-target=bfdname]
[-O bfdname |--output-target=bfdname]
[-s|--strip-all]
[-S|-g|-d|--strip-debug]
[--strip-dwo]
[-K symbolname|--keep-symbol=symbolname]
[-M|--merge-notes][--no-merge-notes]
[-N symbolname |--strip-symbol=symbolname]
[-w|--wildcard]
[-x|--discard-all] [-X |--discard-locals]
[-R sectionname |--remove-section=sectionname]
[--keep-section=sectionpattern]
[--remove-relocations=sectionpattern]
[--strip-section-headers]
[-o file] [-p|--preserve-dates]
[-D|--enable-deterministic-archives]
[-U|--disable-deterministic-archives]
[--keep-section-symbols]
[--keep-file-symbols]
[--only-keep-debug]
[-v |--verbose] [-V|--version]
[--help] [--info]
objfile...

GNU strip discards all symbols from object files objfile. The list of object files may include archives. At least one object file must be given.

strip modifica i file nominati negli argomenti, invece di scrivere copie modificate con nomi differenti.

Tratta il objfile originale come un file con il codice oggetto nel formato bfdname, e lo riscrive nello stesso formato.
Mostra un sommario delle opzioni di strip ed esce.
Visualizza un elenco che mostra tutte le architetture e i formati oggetto disponibili.
Tratta l'originale objfile come file con il codice oggetto nel formato bfdname.
Sostituisce objfile con un file nel formato di output bfdname.
Rimuove tutte le sezioni chiamate sectionname dal file di output. Questa opzione può essere data più di una volta. Notare che l'uso inappropriato di questa opzione può rendere inutilizzabile il file di output. Il carattere "wildcard" * può essere dato alla fine di sectionname. In tal caso, qualsiasi sezione che inizia con sectionname verrà rimossa.

If the first character of sectionpattern is the exclamation point (!) then matching sections will not be removed even if an earlier use of --remove-section on the same command line would otherwise remove it. For example:

--remove-section=.text.* --remove-section=!.text.foo

will remove all sections matching the pattern '.text.*', but will not remove the section '.text.foo'.

When removing sections from the output file, keep sections that match sectionpattern.
Remove relocations from the output file for any section matching sectionpattern. This option may be given more than once. Note that using this option inappropriately may make the output file unusable. Wildcard characters are accepted in sectionpattern. For example:
--remove-relocations=.text.*

will remove the relocations for all sections matching the patter '.text.*'.

If the first character of sectionpattern is the exclamation point (!) then matching sections will not have their relocation removed even if an earlier use of --remove-relocations on the same command line would otherwise cause the relocations to be removed. For example:

--remove-relocations=.text.* --remove-relocations=!.text.foo

will remove all relocations for sections matching the pattern '.text.*', but will not remove relocations for the section '.text.foo'.

Strip section headers. This option is specific to ELF files. Implies --strip-all and --merge-notes.
Rimuove tutti i simboli.
Rimuove solo i simboli di debug.
Remove the contents of all DWARF .dwo sections, leaving the remaining debugging sections and all symbols intact. See the description of this option in the objcopy section for more information.
Remove all symbols that are not needed for relocation processing in addition to debugging symbols and sections stripped by --strip-debug.
Quando viene sguarnito dei simboli, mantiene solo il simbolo symbolname anche se normalmente verrebbe rimosso. Quest'opzione può essere data più di una volta.
For ELF files, attempt (or do not attempt) to reduce the size of any SHT_NOTE type sections by removing duplicate notes. The default is to attempt this reduction unless stripping debug or DWO information.
Rimuove il simbolo symbolname dal file sorgente. Questa opzione può essere data più di una volta, e può essere combinata con opzioni di strip diverse da -K.
Mette il risultato di strip in file, invece di sostituire il file esistente. Quando viene usato questo argomento, può essere specificato solo un argomento objfile.
Preserva le date di accesso e modifica del file.
Opera in modalità deterministica. Quando si copiano i membri dell'archivio e si scrive l'indice di archivio, usa zero per gli UID, i GID e le marcature temporali, e usa permessi di file coerenti per tutti i file.

Se binutils è stato configurato con --enable-deterministic-archives, questa modalità è attiva in modo predefinito. Può essere disabilitata col modificatore -U.

Do not operate in deterministic mode. This is the inverse of the -D option, above: when copying archive members and writing the archive index, use their actual UID, GID, timestamp, and file mode values.

Questo è il predefinito a meno che binutils non sia stato configurato con --enable-deterministic-archives.

Permette le espressioni regolari in symbolname usate in altre opzioni da riga di comando. Gli operatori punto di domanda (?), asterisco (*), barra inversa (\) e parentesi quadre ([]) possono essere usati ovunque nel nome del simbolo. Se il primo carattere del nome del simbolo è il punto esclamativo (!), il senso dell'opzione per tale simbolo è invertito. Per esempio:
-w -K !foo -K fo*

would cause strip to only keep symbols that start with the letters "fo", but to discard the symbol "foo".

Rimuove i simboli non globali.
Rimuove i simboli locali generati dal compilatore. (Questi normalmente iniziano con L o ..)
When stripping a file, perhaps with --strip-debug or --strip-unneeded, retain any symbols specifying section names, which would otherwise get stripped.
Quando semplifica un file, magari con --strip-debug o con --strip-unneeded, mantiene qualsiasi simbolo che specifichi nomi di file sorgenti, che altrimenti sarebbero rimossi.
Strip a file, emptying the contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact. In ELF files, this preserves all the note sections in the output as well.

Note - the section headers of the stripped sections are preserved, including their sizes, but the contents of the section are discarded. The section headers are preserved so that other tools can match up the debuginfo file with the real executable, even if that executable has been relocated to a different address space.

The intention is that this option will be used in conjunction with --add-gnu-debuglink to create a two part executable. One a stripped binary which will occupy less space in RAM and in a distribution and the second a debugging information file which is only needed if debugging abilities are required. The suggested procedure to create these files is as follows:

1.<Collega l'eseguibile come normale. Supponendo che sia chiamato>
"foo" then...
1.<Run "objcopy --only-keep-debug foo foo.dbg" to>
crea un file contenente le informazioni di debug.
1.<Run "objcopy --strip-debug foo" to create a>
eseguibile completamente sguarnito.
1.<Run "objcopy --add-gnu-debuglink=foo.dbg foo">
per aggiungere un collegamento alle informazioni di debugging nell'eseguibile sguarnito.

Nota---la scelta di ".dbg" come estensione del file di informazioni di debug è arbitraria. Anche il passo "--only-keep-debug" è opzionale. Si può invece fare questo:

1.<Collega l'eseguibile come normale.>
1.<Copy "foo" to "foo.full">
1.<Run "strip --strip-debug foo">
1.<Run "objcopy --add-gnu-debuglink=foo.full foo">

ad esempio il file a cui punta --add-gnu-debuglink può essere l'eseguibile completo. Non deve essere un file creato dall'opzione --only-keep-debug.

Note---this switch is only intended for use on fully linked files. It does not make sense to use it on object files where the debugging information may be incomplete. Besides the gnu_debuglink feature currently only supports the presence of one filename containing debugging information, not multiple filenames on a one-per-object-file basis.

Mostra il numero di versione di strip.
Output prolisso: elenca tutti i file oggetto modificati. Nel caso di archivi, strip -v elenca tutti i membri dell'archivio.
@file
Legge le opzioni da riga di comando da file. Le opzioni lette sono inserite al posto dell'opzione originale @file. Se file non esiste o non può essere letto, l'opzione sarà trattata letteralmente, e non rimossa.

Le opzioni in file sono separate da spazi vuoti. Si può includere uno spazio vuoto in un'opzione racchiudendo l'intera opzione fra apici, singoli o doppi. Può essere incluso qualsiasi carattere (compresa la barra inversa) facendo precedere al carattere una barra inversa. Il file può esso stesso contenere ulteriori opzioni @file; ciascuna di queste opzioni sarà elaborata ricorsivamente.

I campi Info per binutils.

Copyright (c) 1991-2024 Free Software Foundation, Inc.

È permesso copiare, distribuire e/o modificare questo documento nei termini della “Licenza per documentazione libera GNU” (GNU Free Documentation License), versione 1.3 o ogni versione successiva pubblicata dalla Free Software Foundation; senza sezioni non modificabili, senza testi di prima di copertina e di quarta di copertina. Una copia della licenza è inclusa nella sezione intitolata “Licenza per la documentazione libera GNU" (GNU Free Documentation License).

La traduzione italiana di questa pagina di manuale è stata creata da Giulio Daprelà <giulio@pluto.it> e Marco Curreli <marcocurreli@tiscali.it>

Questa traduzione è documentazione libera; leggere la GNU General Public License Versione 3 o successiva per le condizioni di copyright. Non ci assumiamo alcuna responsabilità.

Per segnalare errori nella traduzione di questa pagina di manuale inviare un messaggio a pluto-ildp@lists.pluto.it.

1 febbraio 2024 binutils-2.42.0