scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit d2666930876db1425bacbff21d2a0af67a334ac1
parent c419735c1da1cc57c89efdd1a72f8af4482b70cc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Tue, 17 Mar 2026 10:33:33 +0100

doc: Add man page for scc-strip

Diffstat:
Adoc/man1/scc-strip.1 | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/cmd/scc-strip.c | 10+++++-----
2 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/doc/man1/scc-strip.1 b/doc/man1/scc-strip.1 @@ -0,0 +1,73 @@ +.TH STRIP 1 scc\-VERSION +.SH NAME +strip \- remove symbols and relocation information from object files +.SH SYNOPSIS +.B scc-strip +.RI [ file ...] +.SH DESCRIPTION +.B scc-strip +removes the symbol table and relocation information from each object +.I file +specified. +If no +.I file +arguments are given, +.B scc-strip +operates on +.B a.out +by default. +.PP +Stripping an object file reduces its size by discarding information that +is not required for execution, such as symbol names and relocation records. +The resulting file is otherwise functionally equivalent to the original. +.PP +.B scc-strip +processes each file in place. +A temporary file is created alongside the original during processing +and is renamed to replace it upon success. +If an error occurs, the original file is left unchanged. +.SH OPERANDS +.TP +.I file +A pathname of an object file from which symbol and relocation information +is to be removed. +If no operands are given, +.B strip +operates on +.BR a.out . +.SH EXIT STATUS +.TP +.B 0 +Successful completion. +.TP +.B >0 +An error occurred processing one or more files. +.SH EXAMPLES +Strip the default output file: +.IP +.EX +scc-strip +.EE +.PP +Strip a specific object file: +.IP +.EX +scc-strip foo.o +.EE +.PP +Strip multiple files: +.IP +.EX +scc-strip foo.o bar.o baz.o +.EE +.SH STANDARDS +The +.B scc-strip +utility is designed to conform to IEEE Std 1003.1-2008 (POSIX.1). +.SH LICENSE +See the LICENSE file for the terms of redistribution. +.SH SEE ALSO +.BR scc-ar (1), +.BR scc-nm (1), +.BR scc-ranlib (1), +.BR scc-objdump (1) diff --git a/src/cmd/scc-strip.c b/src/cmd/scc-strip.c @@ -18,7 +18,7 @@ error(char *fmt, ...) va_list va; va_start(va, fmt); - fprintf(stderr, "strip: error: %s: ", filename); + fprintf(stderr, "scc-strip: error: %s: ", filename); vfprintf(stderr, fmt, va); putc('\n', stderr); va_end(va); @@ -27,7 +27,7 @@ error(char *fmt, ...) } static void -doit(char *fname) +strip(char *fname) { int type; size_t r; @@ -104,7 +104,7 @@ err1: static void usage(void) { - fputs("usage: strip [file...]\n", stderr); + fputs("usage: scc-strip [file...]\n", stderr); exit(EXIT_FAILURE); } @@ -117,10 +117,10 @@ main(int argc, char *argv[]) } ARGEND if (argc == 0) { - doit("a.out"); + strip("a.out"); } else { for (; *argv; ++argv) - doit(*argv); + strip(*argv); } return status;