STRIP(1) General Commands Manual STRIP(1)

stripremove unnecessary information from executable

files

strip file ...

The strip utility shall remove from executable files named by the file operands any information the implementor deems unnecessary to proper execution of those files. The nature of that information is unspecified. The effect of strip shall be the same as the use of the −s option to any of the compilers defined by this standard.

None.

The following operand shall be supported by the implementation:

file

A pathname referring to an executable file.

None.

The input files shall be in the form of executable files successfully produced by any compiler defined by this standard.

The following environment variables shall affect the execution of strip:

This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_ ) do not specify a locale. See 2.6.

This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_.

This variable shall determine the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments).

This variable shall determine the language in which messages should be written.

Default.

None.

Used only for diagnostic messages.

The strip utility shall produce executable files of unspecified format.

None.

The strip utility shall exit with one of the following values:

Successful completion.

An error occurred.

Default.

None.

Historically, this utility has been used to remove the symbol table from an executable file. It was included since it is known that the amount of symbolic information can amount to several megabytes; the ability to remove it in a portable manner was deemed important, especially for smaller systems. The behavior of strip is said to be the same as the −s option to a compiler. While the end result is essentially the same it is not required to be identical. The same effect can be achieved with either −s during a compile or a strip on the final object file.

Section 7: Language-Independent System Services

This clause contains functional specifications for services that give applications access to features defined elsewhere in this standard. These services allow applications written in high-level languages to

  1. execute commands using the shell language,
  2. obtain values of environment variables,
  3. perform regular expression and pattern matching,
  4. process command arguments in a standard manner,
  5. generate pathnames from a pattern,
  6. perform shell word expansions,
  7. obtain system configuration information, and
  8. set locale control information

This clause does not define interfaces, but services that shall be provided by the interfaces in a language-dependent binding. This clause is optional, in that an implementation is not required to support any language binding to these services. However, any language binding shall support all of the services described here. Implementations therefore provide support for services in this clause by supplying a language-dependent binding such as the one defined in Annex B. Such a system would specify conformance to the language-dependent binding, not to the language-independent bindings given here.

7.0.1 Language-Independent System Services Rationale. (This subclause is not a part of P1003. 2)

Section 7 essentially is a metastandard, in that it specifies services that must be in a language-dependent binding. An implementation conforms to a specific language-dependent binding such as for the C language, in Annex B, and the language-dependent binding must conform to the specifications in this clause. In this standard, the language-independent specifications have not yet been developed. The language-independent syntax is being created in parallel by the POSIX. 1 working group. Therefore, the C language bindings temporarily described in Annex B are actually the full interface specifications. It is the intention of the P1003. 2 working group to rectify this situation in a later supplement by moving the majority of the interface specifications back into this clause,

Language-Independent System Services 719

leaving Annex B with only brief descriptions of the C bindings to those services. This clause does not attempt to include everything that would be required of a language binding. The services here are those that are necessary to make use of features defined elsewhere in the standard, but that are not normally available in every language. Clearly a language that could not open, read, and write the files manipulated by the utilities in this standard would not be very useful, but this service is normally provided by any language and therefore isn’t called out here. The ability to obtain values of environment variables exported from the shell, on the other hand, is not universally available, so that service is included here.

7.1 Shell Command Interface

7.1.1 Execute Shell Command

Any language binding to Language-Independent System Services shall include a facility to execute a shell command. The language-independent specification for this facility has not been developed. The C binding for this facility is the () function described in B.3.1.

7.1.2 Pipe Communications with Programs

Any language binding to Language-Independent System Services shall include a facility to execute a shell command, and to write the standard input or read the standard output of that command via a pipe. The language-independent specification for this facility has not been developed. The C binding for this facility is the () and () functions described in B.3.2.

7.2 Access Environment Variables Any language binding to Language-Independent System Services shall include a facility to obtain values of environment variables, as specified in POSIX. 1 {8}. The language-independent specification for this facility has not been developed. The C binding for this facility is the () function described in POSIX. 1 {8} chgrp(1) .

7 Language-Independent System Services

7.2.1 Access Environment Variables Rationale. (This subclause is not a part of P1003. 2)

This facility is required in POSIX. 2 so that applications can obtain values of exported shell variables.

7.3 Regular Expression Matching Any language binding to Language-Independent System Services shall include a facility to interpret regular expressions as described in 2.8. The language-independent specification for this facility has not been developed. The C binding is the (), (), and () functions described in B.5.

7.3.1 Regular Expression Matching Rationale. (This subclause is not a part of P1003. 2)

This service is important enough that it should be required by any language binding to POSIX. 2. Regular expression parsing and pattern matching are listed separately, since they are different services. A language binding could provide different functions to support regular expressions and patterns, or could combine them into a single function.

7.4 Pattern Matching Any language binding to Language-Independent System Services shall include a facility to interpret patterns as described in 3.13.1 and 3.13.2. This facility shall allow the application to specify whether a slash character in the string to be matched will be treated as a regular character, or must be explicitly matched against a slash in the pattern. The language-independent specification for this facility has not been developed. The C binding is the () function described in B.6.

7.5 Command Option Parsing Any language binding to Language-Independent System Services shall include a facility to parse the options and operands from the command line that invoked the application. The language-independent specification for this facility has not been developed. The C binding for this facility is the () function described in B.7.

7.5 Command Option Parsing 721

7.6 Generate Pathnames Matching a Pattern Any language binding to Language-Independent System Services shall include a facility to generate pathnames matching a pattern as described in 3.13. The language-independent specifications for this facility has not been developed. The C binding is the () and () functions described in B.8.

7.7 Perform Word Expansions Any language binding to Language-Independent System Services shall include a facility to do shell word expansions as described in 3.6. The language-independent specification for this facility has not been developed. The C binding is the () and () functions described in B.9.

7.7.1 Perform Word Expansions Rationale. (This subclause is not a part of P1003. 2)

See the rationale for this function in B.9.

7.8 Get POSIX Configurable Variables

7.8.1 Get String-Valued Configurable Variables

Any language binding to Language-Independent System Services shall include a facility to obtain string configurable variables. The language-independent specification for this facility has not been developed. The C binding for this facility is the () function described in B.10.1.

7.8.2 Get Numeric-Valued Configurable Variables

Any language binding to Language-Independent System Services shall include facilities to determine the current values of system and pathname limits or options (variables), as specified by POSIX. 1 {8}. The configurable variables listed in Table 7-1, which are defined in POSIX. 1 {8}, shall be available in any POSIX. 2 language-dependent binding, with minimum values as given in POSIX. 1 {8}. Other POSIX. 1 {8} configurable variables may be supported, but are not required by POSIX. 2. This facility shall also make available current values for all system limits defined in 2.13. The language-independent specifications for these facilities have not been developed. The C bindings are the () function described in POSIX. 1 {8} chown(1) , and the () and () functions defined in POSIX. 1 {8} 5.7.

7 Language-Independent System Services

7.8.2.1 Get Numeric-Valued Configurable Variables Rationale. (This subclause is not a part of P1003. 2)

This description calls out specific values that (), (), and () are required to support. Some of the POSIX. 1 {8} values are excluded from this list because they are not relevant in a POSIX. 2-only environment. Currently, only is not required by POSIX. 2. This description does not specify the name values for the arguments to the various functions. This is because different language bindings might use different naming conventions, or might use a completely different scheme for obtaining the required configurable values. Specific names for the name values for the C language binding are given in B.10.2.

7.9 Locale Control Any language binding to Language-Independent System Services shall include a facility to set locale control information. The language-independent specification for this facility has not been developed. The C binding for this facility is described in B.11.

7.9.0.1 Locale Control Rationale. (This subclause is not a part of P1003. 2)

This facility is required in POSIX. 2 so that applications can control the locale, which affects the operation of POSIX. 2 utilities.

Table 7-1 − POSIX. 1 Numeric-Valued Configurable Variables

7.9 Locale Control 723

Annex A (normative) C Language Development Utilities Option

This annex describes utilities used for the development of C language applications, including compilation or translation of C source code and complex program generators for simple lexical tasks and processing of context-free grammars. The utilities described in this annex may be provided by the conforming system; however, any system claiming conformance to the C Language Development Utilities Option shall provide all of the utilities described here. The utilities described in Section 6 are prerequisites to this annex.

A.0.1 C Language Development Utilities Option Rationale. (This subclause is not a part of P1003. 2)

The portions of this standard that concern specific languages—currently C and FORTRAN —have been collected to the rear of the document as Normative Annexes. For purposes of conformance, they are no less a part of the standard than one of the numbered sections. They were grouped as Annexes to illustrate that the base standard is [planned to be] language independent, giving a small degree of separation. The working group also wished to send a message to those groups planning other language bindings: the standard is not C-oriented, and there’s plenty of room to add more annexes for your languages as you develop them, right alongside C and FORTRAN.

Annex A C Language Development Utilities Option 725

September 1991 posix.fail