SEG_ADDR_TABLE(l)

NAME
seg_addr_table - re-layout, update or check a segment address table

SYNOPSIS
seg_addr_table [operation] [options] [-o output_file]

DESCRIPTION
seg_addr_table re-lays out, updates or checks a segment address table. If it can do its operation with out problems seg_addr_table(l) exits with zero status. Else it exits with a non-zero status and prints an error message about the problem.

The Apple Build and Integration team uses the segment address table in /AppleInternal/Developer/seg_addr_table to set the preferred addresses of dynamic libraries. See the ld(1) man page under the -seg_addr_table option and its environment variable LD_SEG_ADDR_TABLE.

The format of segment address table are lines of three forms. The entries in the table are lines containing either a single hex address and an install name or two hex addresses and an install name. In the first form the single hex address is used for ``flat'' libraries and is the -seg1addr . In the second form is used for ``split'' libraries and the first address is the -segs_read_only_addr address and the second is the -segs_read_write_addr address. The third form is used for fixed regions that are not to be allocated. They have a hex addresses and a hex size and the literal string <<< Fixed address and size not to assign >>> . Lines starting with the # character are treated as comments.

The output table of seg_addr_table(l) also contains two special entries. One for the next addresses to assign ``flat'' libraries and one for the next addresses to assign to ``split'' libraries. Comments are generated before these entries stating they must not be removed.

The following option must be specified when using the -relayout or -update options:

-o output_file
    Write the new segment address table to output_file.

One of the following operations must be specified:

-relayout
    This causes the entire table to be re-laied out and all dynamic libraries to be assigned addresses. The address are assigned in the order specified and the space given to each is based on the libraries virtual address sizes.

-update
    Only entries with zero address values are assigned addresses. The address assignment is based on the special entries in the table for the next addresses to assign.

-update_overlaps
    Detects overlaps in the table and reassigns the lower of the two addresses. The address assignment is based on the special entries in the table for the next addresses to assign. This action is similar to detecting overlaps with -checkonly, setting the overlapping library to 0x00000000 and running with -update.

-checkonly
    This option only checks the entries in the table for overlaps.

The following options may be specified with any of the operations:

-seg_addr_table filename
    This is the input segment address table. If not specified the default is /AppleInternal/Developer/seg_addr_table.

-release release_name
    For each ``flat'' entry in the table try finding and using the dynamic library from the $(SYMROOT) from the specified release_name to base the size of the library on. If the file in not found in the $(SYMROOT) or it is a ``split'' entry then use the dynamic library in the $(DSTROOT) from the specified release_name to base the size of the library on. Without this option the library with the install name on the machine running is used. With this option the library with the install name on the machine running is never used.

The following options may be specified with the -relayout operation:

-seg1addr addr
    Specifies the starting address to layout ``flat'' libraries. addr is a hexadecimal number and should be a multiple of the target pagesize. The default if not specified is 0x41300000.

-segs_read_only_addr addr
    Specifies the starting address to layout the read-only segments of ``split'' libraries. addr is a hexadecimal number and should be a multiple of the target pagesize. The default if not specified is 0x70000000.

-segs_read_write_addr addr
    Specifies the starting address to layout the read-write segments of ``split'' libraries. addr is a hexadecimal number and should be a multiple of the target pagesize. The default if not specified is 0x80000000.

The following options may be specified with any operation:

-disablewarnings
    This option disables a small number of warnings which is useful for B&I when running the -update operation and there are entries in the table that have problems. These entries are then removed from the table when creating the output.

-arch arch_type
    Specifies the architecture, arch_type, in the files to use for the sizes. More than one -arch arch_type can be specified. The default is -arch all which uses all architectures in the file. See arch(3) for the currently known arch_types.

SEE ALSO
ld(1)