ldedit Command

Purpose

Modifies an XCOFF executable file header.

Syntax

ldedit -b Option [ -V ] File

Description

You can use the ldedit command to modify various fields in an XCOFF header or the auxiliary header of an executable file. The ldedit command makes it possible to mark or unmark an application as a 'large page data' program. The ldedit command also makes it possible to add or modify the values of MAXDATA and MAXSTACK without relinking.

The format of the -b flag is similar to the format used by the link editor, the ld command. The -b flag can be used multiple times on the command line.

If no flags are specified, the ldedit command displays a usage message using the standard error output.

Flags

Item Description
-b Option Modifies an executable as specified by Option. The possible values for Option are:
datapsize:psize
Requests psize page sizes in bytes for data. The value can be specified as a decimal, hexadecimal, or octal number. The number specifications are the same as in C programming language. Additionally, the page sizes can be specified as a number followed by a one-character suffix:
  • k or K for kilo or 0x400 bytes
  • m or M for mega or 0x100000 bytes
  • g or G for giga or 0x40000000 bytes
  • t or T for tera or 0x10000000000 bytes
  • p or P for peta or 0x4000000000000 bytes
  • x or X for exo or 0x1000000000000000 bytes
For example, either -b datapsize:16k or -b datapsize:0x4000 will request 0x4000 for data and set the F_VARPG bit in the XCOFF header. It is accomplished by setting the corresponding member of the auxiliary header to the logarithm base 2 of the given value psize. If the value is different from 0, the F_VARPG bit of the XCOFF header's f_flags member is also set. Otherwise, this bit is cleared.
lpdata
Marks a file as a 'large page data' executable.
nolpdata
Unmarks a file as a 'large page data' executable.
noshrsymtab
Clears the _AOUT_SHR_SYMTAB flag in the XCOFF auxiliary header. If File is a 32-bit object, no change is made.
maxdata:value
Sets the MAXDATA value. value is an octal number when it starts with 0, a hexadecimal number when it starts with 0x, and a decimal number in all other cases.
maxdata:value/dsa
Sets the MAXDATA value and the DSA bit. value is an octal number when it starts with 0, a hexadecimal number when it starts with 0x, and a decimal number in all other cases.
 
maxstack:value
Sets the MAXSTACK value. value is an octal number when it starts with 0, a hexadecimal number when it starts with 0x, and a decimal number in all other cases.
norwexec
Marks a file's writable and mappable sections and stack as non-executable.
rwexec
Marks a file's writable and mappable sections and stack as executable.
shrsymtab
Sets the _AOUT_SHR_SYMTAB flag in the XCOFF auxiliary header. If File is a 64-bit program, a shared symbol table is created when the program is run. If Flag is a 64-bit object but not a 64-bit program, the _AOUT_SHR_SYMTAB flag can be set, but has no effect at runtime. If File is a 32-bit object, no change is made.
 
stackpsize:psize
Requests psize page sizes in bytes for process main thread stack. The value can be specified as a decimal, hexadecimal, or octal number. The number specifications are the same as in C programming language. Additionally, the page sizes can be specified as a number followed by a one-character suffix:
  • k or K for kilo or 0x400 bytes
  • m or M for mega or 0x100000 bytes
  • g or G for giga or 0x40000000 bytes
  • t or T for tera or 0x10000000000 bytes
  • p or P for peta or 0x4000000000000 bytes
  • x or X for exo or 0x1000000000000000 bytes
For example, either -b stackpsize:16k or -b stackpsize:0x4000 will request 0x4000 for process main thread stack and set the F_VARPG bit in the XCOFF header. It is accomplished by setting the corresponding member of the auxiliary header to the logarithm base 2 of the given value psize. If the value is different from 0, the F_VARPG bit of the XCOFF header's f_flags member is also set. Otherwise, this bit is cleared.
textpsize:psize
Requests psize page sizes in bytes for text. The value can be specified as a decimal, hexadecimal, or octal number. The number specifications are the same as in C programming language. Additionally, the page sizes can be specified as a number followed by a one-character suffix:
  • k or K for kilo or 0x400 bytes
  • m or M for mega or 0x100000 bytes
  • g or G for giga or 0x40000000 bytes
  • t or T for tera or 0x10000000000 bytes
  • p or P for peta or 0x4000000000000 bytes
  • x or X for exo or 0x1000000000000000 bytes
For example, either -b textpsize:16k or -b textpsize:0x4000 will request 0x4000 for text and set the F_VARPG bit in the XCOFF header. It is accomplished by setting the corresponding member of the auxiliary header to the logarithm base 2 of the given value psize. If the value is different from 0, the F_VARPG bit of the XCOFF header's f_flags member is also set. Otherwise, this bit is cleared.
-V Prints the version of the ldedit command on the standard error output.

Example

  1. To request system-selected page sizes for text, data, and stacks, enter:
    ldedit -b textpsize:0 -b datapsize:0 -b stackpsize:0
    This clears the F_VARPG bit in the XCOFF header.