SEG_ADDR_TABLE(l)

πŸ“¦ version 1010.6, in nixpkgs unstable

okay so this is the SEG_ADDR_TABLE(l) manual page, and honestly? it's giving "niche build-system lore that absolutely slaps." stay with me bestie, we're gonna get through every single flag together πŸ’…

✨ 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 without problems, seg_addr_table(l) exits with zero status. Otherwise it exits with a non-zero status and prints an error message about the problem. no cap, that's the whole success metric.

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. Go peek at the ld(1) man page under the -seg_addr_table option and its environment variable LD_SEG_ADDR_TABLE β€” that's where the lore connects πŸ”₯

The format of segment address table is 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, it's used for ``split'' libraries β€” 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 address and a hex size and the literal string <<< Fixed address and size not to assign >>>.

Lines starting with the # character are treated as comments. periodt.

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. like, do NOT touch them, bestie πŸ™ˆ

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-laid out and all dynamic libraries to be assigned addresses. The addresses are assigned in the order specified and the space given to each is based on the library's 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.
  • -relayout_nonsplit β€” Similar to relayout except it only causes all the non split libraries to be re-laid out and all non-split dynamic libraries to be assigned addresses. The addresses are assigned in order specified and the space given to each is based on the library's virtual address sizes.
  • -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 is 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. literally never πŸ‘‘

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 when the environment variable MACOSX_DEPLOYMENT_TARGET is 10.1 or not set and allocations are into increasing addresses. When MACOSX_DEPLOYMENT_TARGET is 10.2 or greater the default is 0x7ffc0000 and allocations are into decreasing addresses.
  • -allocate_flat direction β€” Specifies which direction to allocate flat addresses into. The argument direction can be either increasing or decreasing. The default if not specified is increasing when the environment variable MACOSX_DEPLOYMENT_TARGET is 10.1 or not set, and when MACOSX_DEPLOYMENT_TARGET is 10.2 or greater the default is decreasing.
  • -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 when the environment variable MACOSX_DEPLOYMENT_TARGET is 10.1 or not set, and when MACOSX_DEPLOYMENT_TARGET is 10.2 or greater the default is 0x90000000.
  • -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 when the environment variable MACOSX_DEPLOYMENT_TARGET is 10.1 or not set, and when MACOSX_DEPLOYMENT_TARGET is 10.2 or greater the default is 0xa0000000.

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)


and that's the whole vibe check πŸ’– this icon was brought to you by Apple Computer, Inc., dated May 24, 2002, and it lives under the name SEG_ADDR_TABLE(l) β€” slay, honestly 🫢✨

πŸ“¦ where this page comes from