Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / mcs.1
bloba5505c23400be5a0645bb369975a0b8b4d7ccdf0
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2007, Sun Microsystems, Inc.  All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH MCS 1 "Oct 5, 2007"
8 .SH NAME
9 mcs \- manipulate the comment section of an object file
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBmcs\fR [\fB-cdpVz\fR] [\fB-a\fR \fIstring\fR] [\fB-n\fR \fIname\fR] \fIfile\fR...
14 .fi
16 .SH DESCRIPTION
17 .sp
18 .LP
19 The \fBmcs\fR command is used to manipulate a section, by default the
20 \fB\&.comment\fR section, in an \fBELF\fR object file. It is used to add to,
21 delete, print, and compress the contents of a section in an \fBELF\fR object
22 file, and print only the contents of a section in a \fBCOFF\fR object file.
23 \fBmcs\fR cannot add, delete, or compress the contents of a section that is
24 contained within a segment.
25 .sp
26 .LP
27 If the input file is an archive (see \fBar.h\fR(3HEAD)), the archive is treated
28 as a set of individual files. For example, if the \fB-a\fR option is specified,
29 the string is appended to the comment section of each \fBELF\fR object file in
30 the archive; if the archive member is not an \fBELF\fR object file, then it is
31 left unchanged.
32 .sp
33 .LP
34 \fBmcs\fR must be given one or more of the options described below. It applies,
35 in order, each of the specified options to each file.
36 .sp
37 .LP
38 For operations other than delete, if the object does not already contain a
39 section with the specified name, \fBmcs\fR will create a new empty section with
40 that name before performing the specified operation.
41 .SH OPTIONS
42 .sp
43 .LP
44 The following options are supported:
45 .sp
46 .ne 2
47 .na
48 \fB\fB-a\fR \fIstring\fR\fR
49 .ad
50 .RS 13n
51 Appends \fIstring\fR to the comment section of the \fBELF\fR object files. If
52 \fIstring\fR contains embedded blanks, it must be enclosed in quotation marks.
53 .RE
55 .sp
56 .ne 2
57 .na
58 \fB\fB-c\fR\fR
59 .ad
60 .RS 13n
61 Compresses the contents of the comment section of the \fBELF\fR object files.
62 All duplicate entries are removed. The ordering of the remaining entries is not
63 disturbed.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fB-d\fR\fR
70 .ad
71 .RS 13n
72 Deletes the contents of the specified section from the \fBELF\fR object files.
73 The section header for the comment section is also removed.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fB-n\fR \fIname\fR\fR
80 .ad
81 .RS 13n
82 Specifies the name of the section to access if other than \fB\&.comment\fR. By
83 default, \fBmcs\fR deals with the section named \fB\&.comment\fR. This option
84 can be used to specify another section. \fBmcs\fR can take multiple \fB-n\fR
85 options to allow for specification of  multiple sections.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fB-p\fR\fR
92 .ad
93 .RS 13n
94 Prints the contents of the comment section on the standard output. Each section
95 printed is tagged by the name of the file from which it was extracted, using
96 the format \fIfile\fR\fB[\fR\fImember_name\fR\fB]:\fR for archive files and
97 \fIfile\fR\fB:\fR for other files.
98 .RE
101 .ne 2
103 \fB\fB-V\fR\fR
105 .RS 13n
106 Prints on standard error the version number of \fBmcs\fR.
110 .ne 2
112 \fB\fB-z\fR\fR
114 .RS 13n
115 Replaces any \fBSHT_PROGBITS\fR sections with zeros while retaining the
116 original attributes of the sections.
119 .SH EXAMPLES
121 \fBExample 1 \fRPrinting a file's comment section
124 The following entry
127 .in +2
129 example% \fBmcs -p elf.file\fR
131 .in -2
136 prints the comment section of the file \fBelf.file\fR.
139 \fBExample 2 \fRAppending a string to a comment section
142 The following entry
145 .in +2
147 example% \fBmcs -a  xyz elf.file\fR
149 .in -2
154 appends string \fBxyz\fR to \fBelf.file\fR's comment section.
157 \fBExample 3 \fRStripping a specified non-allocable section
160 Although used primarily with comment sections, \fBmcs\fR can operate on any
161 non-allocable section. In contrast to the \fBstrip\fR command, which removes a
162 predefined selection of non-allocable sections, \fBmcs\fR can be used to delete
163 a specific section. The following entry
166 .in +2
168 example% \fBmcs -d -n .annotate elf.file\fR
170 .in -2
175 removes the section named \fB\&.annotate\fR from the file \fBelf.file\fR.
177 .SH FILES
179 .ne 2
181 \fB\fB/tmp/mcs*\fR\fR
183 .RS 13n
184 temporary files
187 .SH ATTRIBUTES
190 See \fBattributes\fR(5) for descriptions of the following attributes:
195 box;
196 c | c
197 l | l .
198 ATTRIBUTE TYPE  ATTRIBUTE VALUE
200 Interface Stability     Stable
203 .SH SEE ALSO
206 \fBar\fR(1), \fBas\fR(1), \fBld\fR(1), \fBstrip\fR(1), \fBar.h\fR(3HEAD),
207 \fBelf\fR(3ELF), \fBtmpnam\fR(3C), \fBa.out\fR(4), \fBattributes\fR(5)
208 .SH NOTES
211 When \fBmcs\fR deletes a section using the \fB-d\fR option, it tries to bind
212 together sections of type \fBSHT_REL\fR and target sections pointed to by the
213 \fBsh_info\fR section header field. If one is to be deleted, \fBmcs\fR attempts
214 to delete the other of the pair.
217 By using the \fB-z\fR option, it is possible to make an object file by removing
218 the contents of \fBSHT_PROGBITS\fR sections while retaining the object file's
219 original structure as an \fBELF\fR file. The need for use of the \fB-z\fR
220 option is limited. However, the option can be used to deliver an object file
221 when the contents of \fBSHT_PROGBITS\fR sections are not relevant.