Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


ModPEF

Tool

SYNTAX

ModPEF file -o fileName [-@addexports fragSpec=fileName]
[-@alias fragSpec=fileName] [-c creator]
[-delete fragSpec[,fragSpec]…] [-deleteexports fragSpec=name[,name]…]
[-@deleteexports fragSpec=fileName] [-describe on | off]
[-extract fragSpec[,fragSpec]…] [-initbefore fragSpec=name[,name]…]
[-level fragSpec=base | update] [-list] [-mergecode on | off]
[-mf | -nomf] [-noinitbefore fragSpec=name[,name]…]
[-noweak fragSpec=name[,name]…] [-@noweak fragSpec=fileName]
[-noweaklib fragSpec=name[,name]…] [-p]
[-renamefrag fragSpec=name] [-@renamesymbols fragSpec=fileName]
[-share fragSpec=context | global | protected | n]
[-stacksize fragSpec=n] [-t type] [-usage fragSpec=lib[rary]
| app[lication] | dropin | stub | weakstub | n] [-v]
[-vercur fragSpec=n] [-verdef fragSpec=n] [-verimp fragSpec=n]
[-w[arn]] [-weak fragSpec=name[,name]…] [-@weak fragSpec=fileName]
[-weaklib fragSpec=name[,name]…]

A fragSpec identifies a particular fragment within a file. Its syntax is:

fragSpec ::= fragName[(fragInfo[,fragInfo]…)]

A fragName is the name of a fragment and is case-sensitive. Its syntax is:

fragName ::= characters other than '(', ')', '=' and ','
fragName ::= '*'     (matches any fragment name)

A fragInfo provides additional information which is used to identify a particular fragment within a file. Its syntax is:

fragInfo ::= [arch=]pwpc | [arch=]m68k | arch=n |
[usage=]lib[rary] | [usage=]app[lication] | [usage=]dropin |
[usage=]stub | [usage=]weakstub | usage=n |
[level=]base | [level=]update | level=n |
vercur=n | verdef=n

DESCRIPTION

ModPEF copies fragments from an existing PEF file to a new PEF file. ModPEF can also modify the attributes of the copied fragments. ModPEF does not touch the resource fork except for reading and writing the 'cfrg' resource and copying 'rseg' and 'CODE' resources for CFM-68K applications.

INPUT

A PEF file containing one or more fragments. The input file is never modified.

OUTPUT

A new PEF file containing one or more, possibly modified, fragments from the input file. The -o option must be used to name the output file.

STATUS

ModPEF can return the following status codes:

0

no errors

1

fatal error

PARAMETERS

file

Specifies a PEF file containing one or more fragments.

OPTIONS

NOTE
Some of the command line options are order-sensitive. If a fragment is affected by several options, the changes are done in the order the options appear on the command line. Renaming a fragment or changing its version numbers does not affect fragment matching; the matching is done prior to any renaming/reversioning. •

-@addexports fragSpec=fileName

Adds exported symbols to the specified fragment. The symbols specified by the text file fileName are added to the exported symbols section of the fragment. The format of the lines in the text file are as follows:

name section[:]offset [class]

The name is the name of the symbol to be exported.

The section is one of the following keywords:

code | data | none | absolute | transfer

The keyword none indicates section number -1. The keyword absolute indicates section number -2. The keyword transfer indicates section number -3.

The offset is a numeric offset into the section.

The optional class is a number or one of the following keywords:

code | data | tvector | tocentry | glue

The default symbol class is data.

Lines beginning with '#' or '*' are treated as comments.

-@alias fragSpec=fileName

Assigns aliases to exported symbols in the specified fragment and adds the aliases to the exported symbols section. The original symbol names remain exported. The format of the lines in the text file fileName are as follows:

exportName aliasName

Lines beginning with '#' or '*' are treated as comments.

-c creator

Sets the output file creator to creator. The default creator is the same as the input file creator.

-delete fragSpec[,fragSpec]…

Deletes the specified fragments when copying the input file to the output file. All fragments except those marked for deletion are copied to the output file. This option can not be used in conjunction with the -extract option.

-deleteexports fragSpec=name[,name]…

Deletes the specified symbols from the exported symbols section of the specified fragment.

-@deleteexports fragSpec=fileName

Deletes exported symbols from the specified fragment. The symbols specified by the text file fileName are removed from the exported symbols section of the fragment. The text file should contain one symbol name per line. Lines beginning with '#' or '*' are treated as comments.

-describe on | off

Specifies whether the fragment changes should be described.

on

Describes the changes.

off

Does not describe the changes.

-extract fragSpec[,fragSpec]…

Extracts the specified fragments from the input file and copies them to the output file. Only those fragments marked for extraction are copied to the output file. This option can not be used in conjunction with the -delete option.

-initbefore fragSpec=name[,name]…

Marks the specified import libraries in the specified fragment as "initbefore". Note that when specifying the name of an import library, you must use the library's fragment name not the name of the file containing the library.

-level fragSpec=base | update

Changes the specified fragment's "level".

base

Sets the level to "full library".

update

Sets the level to "update library".

-list

Lists the fragments contained in the input file by extracting information from the 'cfrg' resource. For each fragment, the information listed includes the fragment name, the architecture type, the fragment level, the current version number and the definition version number.

-mergecode on | off

Specifies whether the code sections should be adjacent in the output file.

on

Creates overlapping fragments in the output file. The code sections of each fragment are made physically adjacent. This can improve paging behavior when fragments are loaded from the file. Note that this option has no effect on CFM-68K applications since the code is stored in the resource fork.

off

Does not make the code sections adjacent in the output file.

-mf | -nomf

Enables or suppresses the use of Process Manager temporary memory.

Note that the ModPEF tool's use of Process Manager temporary memory excludes other applications from using it, including the Finder. If Process Manager temporary memory is unavailable, this option has no effect.

WARNING
If ModPEF aborts abnormally, that is, there is a crash or a nonmaskable interrupt (NMI), much of the Process Manager temporary memory might be left permanently allocated, thus potentially crippling launches and Finder copy operations. The only way to recover from this situation is to restart the computer. •

-noinitbefore fragSpec=name[,name]…

Marks the specified import libraries in the specified fragment as "non-initbefore". Note that when specifying the name of an import library, you must use the library's fragment name not the name of the file containing the library.

-noweak fragSpec=name[,name]…

Marks the specified imported symbols in the specified fragment as "non-weak".

-@noweak fragSpec=fileName

Marks the specified imported symbols in the specified fragment as "non-weak". The text file should contain one symbol name per line. Lines beginning with '#' or '*' are treated as comments.

-noweaklib fragSpec=name[,name]…

Marks the specified import libraries in the specified fragment as "non-weak". Note that when specifying the name of an import library, you must use the library's fragment name not the name of the file containing the library.

-o fileName

Specifies the name of the output file. This option is required.

-p

Writes progress and summary information to diagnostic output.

-renamefrag fragSpec=name

Renames the specified fragment.

-@renamesymbols fragSpec=fileName

Renames symbols in the specified fragment. Each occurrence of the original symbol name is replaced with the new name. Note that this option can rename import libraries, imported symbols and exported symbols. The format of the lines in the text file fileName are as follows:

oldName newName

Lines beginning with '#' or '*' are treated as comments.

-share fragSpec=context | global | protected | n

Changes the specified fragment's data section sharing mode.

context

The data section is shared within a context.

global

The data section is shared across all contexts.

protected

The data section is readable by all contexts but writable only by privileged contexts.

n

Sets the data section sharing mode to the specified value.

-stacksize fragSpec=n

Sets the specified fragment's stack size to the specified value.

-t type

Sets the output file type to type. The default type is the same as the input file type.

-usage fragSpec=lib[rary] | app[lication] | dropin | stub | weakstub | n

Changes the specified fragment's "usage" type.

lib[rary]

Sets the "usage" type to import library.

app[lication]

Sets the "usage" type to application.

dropin

Sets the "usage" type to drop-in addition.

stub

Sets the "usage" type to stub library.

weakstub

Sets the "usage" type to weak stub library.

n

Sets the "usage" type to the specified value.

-v

Writes verbose progress and summary information to diagnostic output. Specifying this option also implies -p.

-vercur fragSpec=n

Changes the specified fragment's "current version" to the specified version number.

-verdef fragSpec=n

Changes the specified fragment's "definition version" to the specified version number.

-verimp fragSpec=n

Changes the specified fragment's "implementation version" to the specified version number.

-w[arn]

Suppresses the display of warning messages.

-weak fragSpec=name[,name]…

Marks the specified imported symbols in the specified fragment as "weak".

-@weak fragSpec=fileName

Marks the specified imported symbols in the specified fragment as "weak". The text file should contain one symbol name per line. Lines beginning with '#' or '*' are treated as comments.

-weaklib fragSpec=name[,name]…

Marks the specified import libraries in the specified fragment as "weak". Note that when specifying the name of an import library, you must use the library's fragment name not the name of the file containing the library.

EXAMPLES

The following are some examples of fragSpecs:

MyFrag
MyFrag(pwpc)
MyFrag(arch=m68k,vercur=5)
'*'
'*(stub)'

SEE ALSO

DumpPEF

ILink

PPCLink

 
 


Last Updated July 2000