HPlogo HP-UX Reference Volume 1 of 5 > c

chatr(1)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

chatr — change program's internal attributes

SYNOPSIS

PA32 SOM chatr

chatr [-nqsMN] [-l library] [-B bind] [+b flag] [+es flag ] [+gst flag ] [+gstbuckets size ] [+gstsize size ] [+k flag] [+l library] [+pd size] [+pi size] [+plabel_cache flag ] [+r flag] [+s flag] file ...

PA64 ELF chatr

There are two possible syntactic forms that can be used to invoke PA64 chatr. The first syntactic form, which is compatible with the SOM chatr, is used for backward compatibility, and for easy manipulation of ordinary files that only have a single text and a single data segment:

chatr [-s] [-l library] [-B mode] [+b flag] [+cd flag] [+ci flag] [+es flag ] [+f flag ] [+gst flag ] [+gstsize size ] [+k flag] [-l library] [+md flag] [+mi flag] [+pd size] [+pi size] [+s flag] [+z flag] files...

The second syntactic form provides the ability to explicitly specify segments to be modified:

chatr [-s] [-B mode] [+s flag] [+k flag] [+dz flag] [[+si index | +sa address | +sall ]... [+z flag] [+r flag] [+p size] [+m flag] [+c flag] [-B mode] [+s flag] [+k flag]... file

DESCRIPTION

PA32 SOM chatr

chatr, by default, prints each file's magic number and file attributes to the standard output.

Options

chatr recognizes the following options:

-l library

Indicate that the specified shared library is subject to run-time path lookup if directory path lists are provided (see +s and +b).

-n

Change file from demand-loaded to shared.

-q

Change file from shared to demand-loaded.

-M

Change file from EXEC_MAGIC to SHMEM_MAGIC. (This option is an interim solution until 64-bit addressability is available with a true 64-bit kernel.)

-N

Change file from SHMEM_MAGIC to EXEC_MAGIC. (This option is an interim solution until 64-bit addressability is available with a true 64-bit kernel.)

-s

Perform its operation silently.

-B bind

Select run-time binding behavior of a program using shared libraries. One of the major binding modes immediate or deferred must be specified. One or more of the binding modifiers nonfatal, verbose, or restricted can also be specified, each with a separate option. See the HP-UX Linker and Libraries User's Guide manual for a description of binding modes.

+b flag

Control whether the directory path list stored when the program was built can be used to locate shared libraries needed by the program. The two flag values, enable and disable, respectively enable and disable use of the path list. See the +s option.

+es flag

Controls the ability of user code to execute from stack with the flag values enable and disable.

+gst flag

Control whether the global symbol table hash mechanism is used to look up values of symbol import/export entries. The two flag values, enable and disable, respectively enable and disable use of the global symbol table hash mechanism. The default is disable.

+gstbuckets size

Request a particular number of buckets per entry using the global symbol table hash mechanism. The value can vary between 1 and MAXINT. The default value is 3. Use this option with +gst enable.

+gstsize size

Request a particular hash array size using the global symbol table hash mechanism. The value can vary between 1 and MAXINT. The default value is 1103. Use this option with +gst enable.

+k flag

Request kernel assisted branch prediction. The flags enable and disable turn this request on and off, respectively.

+l library

Indicate that the specified shared library is not subject to run-time path lookup if directory path lists are provided (see +s and +b).

+pd size

Request a particular virtual memory page size that should be used for data. Sizes of 4K, 16K, 64K, 256K, 1M, 4M, 16M, 64M, 256M, and L are supported. A size of L will result in using the largest page size available. The actual page size may vary if the requested size cannot be fulfilled.

+pi size

Request a particular virtual memory page size that should be used for instructions. See the +pd option for additional information.

+plabel_cache flag

Control the use of the plabel caching mechanism. The flags enable and disable turn this request on and off, respectively. The default is disable. Use this option with +gst enable. This option is effective with C++.

+r flag

Request static branch prediction when executing this program. The flags enable and disable turn this request on and off, respectively.

+s flag

Control whether the directory path list specified with the SHLIB_PATH environment variable can be used to locate shared libraries needed by the program. The two flag values, enable and disable, respectively enable and disable use of the environment variable. If both +s and +b are used, their relative order on the command line indicates which path list will be searched first. See the +b option.

The term shared applies to the magic number SHARE_MAGIC while the term demand-loaded applies to the magic number DEMAND_MAGIC. See magic(4) and the HP-UX Linker and Libraries Online User Guide for more information.

chatr labels the following type of executables in output.

SHARED_MAGIC:

shared executable

DEMAND_MAGIC:

demand load executable

EXEC_MAGIC:

normal executable

SHMEM_MAGIC:

normal SHMEM_MAGIC executable

The linker produces SHARED_MAGIC executables by default.

Upon completion, chatr prints the file's old and new values to standard output unless -s is specified.

The +pd and +pi options only provide a hint for the virtual memory page size. The actual page sizes may vary. Under certain conditions, page size hints of L may result in better performance, depending on the specific memory requirements of the application.

The performance of some applications may benefit from static branch prediction, others may not. The +r option provides a hint for using or avoiding this feature.

The +gst and related options provide proformance enhancements through use of global symbol table which improves searching for exported symbols. See dld.sl(5) and the HP-UX Linker and Libraries Online User Guide for more information.

PA64 ELF chatr

PA64 chatr is similar to SOM chatr but supports some new options and obsoletes some old ones. New options:

+dz

Enables or disables lazy swap allocation for dynamically allocated segments (such as the stack or heap). Valid only with the second command line form.

+p

Set the page size for a specified segment. Only valid with the second command line form.

+md

Set the modification bit for the file's data segment(s). Only valid with the first command line form.

+mi

Set the modification bit for the file's text segment(s). Only valid with the first command line form.

+m

Set the modification bit for a specified segment. Only valid with the second command line form.

+cd

Set the code bit for the file's data segment(s). Only valid with the first command line form.

+ci

Set the code bit for the file's text segments(s). Only valid with the first command line form.

+c

Set the code bit for a specified segment. Only valid with the second command line form.

+z

Enable lazy swap on all data segments (using the first command syntax) or on a specific segment (using the second command syntax). May not be used with non-data segments.

+si

Identify a segment using a segment index number. Valid only with the second command line form.

+sa

Identify a segment using an address. Valid only with the second command line form.

+sall

Use all segments in the file for a set of attribute modifications. Valid only with the second command line form.

Obsolete options: -n, -q, -M, -N, -l, +l.

RETURN VALUE

chatr returns zero on success. If the command line contents is syntactically incorrect, or one or more of the specified files cannot be acted upon, chatr returns the number of files whose attributes could not be modified. If no files are specified, chatr returns decimal 255.

EXTERNAL INFLUENCES

Environment Variables

The following internationalization variables affect the execution of chatr:

LANG

Determines the locale category for native language, local customs and coded character set in the absence of LC_ALL and other LC_* environment variables. If LANG is not specified or is set to the empty string, a default of C (see lang(5)) is used instead of LANG.

LC_ALL

Determines the values for all locale categories and has precedence over LANG and other LC_* environment variables.

LC_CTYPE

Determines the locale category for character handling functions.

LC_MESSAGES

Determines the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

LC_NUMERIC

Determines the locale category for numeric formatting.

NLSPATH

Determines the location of message catalogues for the processing of LC_MESSAGES.

If any internationalization variable contains an invalid setting, chatr behaves as if all internationalization variables are set to C. See environ(5).

In addition, the following environment variable affects chatr:

TMPDIR

Specifies a directory for temporary files (see tmpnam(3S)).

EXAMPLES

Change a.out to demand-loaded

chatr -q a.out

Change binding mode of program file that uses shared libraries to immediate and nonfatal. Also enable usage of SHLIB_PATH environment variable:

chatr -B immediate -B nonfatal +s enable a.out

Disallow run-time path lookup for the shared library /usr/lib/libc.sl that the shared library libfoo.sl depends on:

chatr +l /usr/lib/libc.sl libfoo.sl

NOTES

SHMEM_MAGIC is an interim solution until 64-bit addressability is available with a true 64-bit kernel.

SHMEM_MAGIC will not be supported on future HP implementations of 64-bit architectures (beyond PA2.0). Programs that need larger than 1.75 GB of shared memory on those architectures will have to be recompiled (as 64-bit executables) for those architectures.

Programs that are compiled as 64-bit executables on any 64-bit HP implementation (including PA 2.0) cannot be marked as SHMEM_MAGIC nor do they need to be as they will already have access to more than 1.75 GB of shared memory.

The additional 1 GB of shared memory that is available over other types of executables can be availed of only for system V shared memory and not other forms of shared memory (like memory mapped files).

AUTHOR

chatr was developed by HP.

SEE ALSO

System Tools:

ld(1)

invoke the link editor

Miscellaneous:

a.out(4)

assembler, compiler, and linker output

magic(4)

magic number for HP-UX implementations

Texts and Tutorials:

HP-UX Linker and Libraries Online User Guide

(See the +help option)

HP-UX Linker and Libraries User's Guide

(See manuals(5) for ordering information)

© Hewlett-Packard Development Company, L.P.