'\" te .\" Copyright 1989 AT&T .\" Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. .TH mcs 1 "23 Jan 2012" "SunOS 5.11" "User Commands" .SH NAME mcs \- manipulate the comment section of an object file .SH SYNOPSIS .LP .nf \fBmcs\fR [\fB-cdHpVz\fR] [\fB-A\fR \fIfile\fR] [\fB-a\fR \fIstring\fR][\fB-n\fR \fIname\fR] \fIfile\fR... .fi .SH DESCRIPTION .sp .LP The \fBmcs\fR command is used to display, compress, or append content to comment sections in an \fBELF\fR object file. It can also be used to delete comment or non-comment sections, and to zero \fBSHT_PROGBITS\fR sections. Unless otherwise specified, the section named \fB\&.comment\fR is manipulated. \fBmcs\fR cannot modify or delete a section that is contained within a segment. .sp .LP If the input file is an archive (see \fBar.h\fR(3HEAD)), the archive is treated as a set of individual files. For example, if the \fB-a\fR option is specified, the string is appended to the comment section of each object file in the archive; if the archive member is not an object file, then it is left unchanged. .sp .LP \fBmcs\fR must be given one or more of the options described below. It applies each option, in the order given, to each file. .sp .LP For append operations, if the object does not already contain a section with the specified name, \fBmcs\fR will create a new empty section with that name before performing the append operation. .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-A\fR \fIfile\fR\fR .ad .RS 13n .rt Appends the contents of the given file to the comment section of the object files. .RE .sp .ne 2 .mk .na \fB\fB-a\fR \fIstring\fR\fR .ad .RS 13n .rt Appends \fIstring\fR to the comment section of the object files. .RE .sp .ne 2 .mk .na \fB\fB-c\fR\fR .ad .RS 13n .rt Compresses the contents of the comment section of the object files. All duplicate entries are removed. The ordering of the remaining entries is not disturbed. .RE .sp .ne 2 .mk .na \fB\fB-d\fR\fR .ad .RS 13n .rt Deletes the specified section from the object files. .RE .sp .ne 2 .mk .na \fB\fB-H\fR\fR .ad .RS 13n .rt When \fB-p\fR is used, suppress the output of the name of the file, as well as any blank lines normally inserted between the output for each file. .RE .sp .ne 2 .mk .na \fB\fB-n\fR \fIname\fR\fR .ad .RS 13n .rt Specifies the name of the section to access if other than \fB\&.comment\fR. By default, \fBmcs\fR deals with the section named \fB\&.comment\fR. \fBmcs\fR can take multiple \fB-n\fR options to allow for specification of multiple sections. \fBmcs\fR always manipulations sections assuming that they have the format of a comment section. .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .RS 13n .rt Prints the contents of the comment section on the standard output. Unless used with \fB-H\fR, each section printed is prefixed with the name of the file from which it was extracted, using the format \fIfile\fR\fB[\fR\fImember_name\fR\fB]:\fR for archive files and \fIfile\fR\fB:\fR for other files. .RE .sp .ne 2 .mk .na \fB\fB-V\fR\fR .ad .RS 13n .rt Prints a message on standard error giving information about the version of \fBmcs\fR. .RE .sp .ne 2 .mk .na \fB\fB-z\fR\fR .ad .RS 13n .rt Replaces any \fBSHT_PROGBITS\fR sections with zeros while retaining the original attributes of the sections. .RE .SH EXAMPLES .LP \fBExample 1 \fRPrinting a file's comment section .sp .LP The following entry .sp .in +2 .nf example% \fBmcs -p elf.file\fR .fi .in -2 .sp .sp .LP prints the comment section of the file \fBelf.file\fR. .LP \fBExample 2 \fRAppending a string to a comment section .sp .LP The following entry .sp .in +2 .nf example% \fBmcs -a xyz elf.file\fR .fi .in -2 .sp .sp .LP appends string \fBxyz\fR to \fBelf.file\fR's comment section. .LP \fBExample 3 \fRStripping a specified non-allocable section .sp .LP Although used primarily with comment sections, \fBmcs\fR can operate on any non-allocable section. In contrast to the \fBstrip\fR command, which removes a predefined selection of non-allocable sections, \fBmcs\fR can be used to delete a specific section. The following entry .sp .in +2 .nf example% \fBmcs -d -n .annotate elf.file\fR .fi .in -2 .sp .sp .LP removes the section named \fB\&.annotate\fR from the file \fBelf.file\fR. .SH FILES .sp .ne 2 .mk .na \fB\fB/tmp/mcs*\fR\fR .ad .RS 13n .rt temporary files .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitydeveloper/base-developer-utilities _ Interface StabilityCommitted .TE .SH SEE ALSO .sp .LP \fBar\fR(1), \fBas\fR(1), \fBld\fR(1), \fBstrip\fR(1), \fBar.h\fR(3HEAD), \fBelf\fR(3ELF), \fBa.out\fR(4), \fBattributes\fR(5) .SH NOTES .sp .LP When \fBmcs\fR deletes a section using the \fB-d\fR option, it tries to bind together sections of type \fBSHT_REL\fR and target sections pointed to by the \fBsh_info\fR section header field. If one is to be deleted, \fBmcs\fR attempts to delete the other of the pair. .sp .LP The \fB-z\fR option removes the contents of \fBSHT_PROGBITS\fR sections while retaining the original \fBELF\fR structure of the object. The need for use of the \fB-z\fR option is limited. However, the option can be used to deliver an object file when the contents of \fBSHT_PROGBITS\fR sections are not relevant.