Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Motorola System V 88k Release 3.2 Version 1.2C

Media Vault

Software Library

Restoration Projects

Artifacts Sought



  LD(1)         (Software Generation System Utilities)        LD(1)



  NAME
       ld - linker

  SYNOPSIS
       ld [ options ] files

  DESCRIPTION
       Ld is a linker which is designed to be small and  fast,  for
       use  primarily as a backend to the Unix C compiler.  Some of
       ld's specifications include:


       o  Uses the COFF format for object files.

       o  Supports separate address spaces for text and data.

       o  On the m88k, performs 32-bit literal synthesis  for  data
          accesses  to  objects  above  address  0xFFFF in the data
          address space.

       o  Supports coalescing of separate  object  modules  into  a
          single  object  module  which  can  be  used  as input to
          another ld run.

       o  Uses memory rather aggressively, so is 4-8  times  faster
          than standard System V linker.

       The symbols "etext", "edata" and "end" ("etext",  "edata"
       and  "end"  in  C)  are  reserved,  and are set to the first
       location  above  the  program,  the  first  location   above
       initialized  data,  and  the  first location above all data,
       respectively.  No storage is allocated at  these  addresses.
       The linker will issue a warning if it finds a definition for
       these  symbols.   Ld  supports  a  subset  of  the   options
       supported  by  the  normal  linker,  plus  some  options not
       supported in the normal linker.  The supported options are:

       -B base   Use base as the base address of the  bss  section.
                 The  address  may  be specified in octal (0nnn..),
                 hex (0Xnnn...), or decimal (nnn...).


  Page 1                                                   May 1989


















  LD(1)         (Software Generation System Utilities)        LD(1)



       -e symbol Set the entry point for the output file to be  the
                 address of symbol.  The default entry point symbol
                 is "__start".  If the entry point  symbol  is  not
                 found,  the  entry  point  is  set  to the virtual
                 address of the start of text.

       -D base   Use base as the base address of the data  section.
                 The  address  may  be specified in octal (0nnn..),
                 hex (0Xnnn...), or decimal (nnn...).

       -F magic  Build an executable file with the format specified
                 by magic.  Currently recognized magic numbers are:

       0407      The executable is linked  with  text  starting  at
                 address   zero,   followed  immediately  by  data,
                 followed immediately by bss.  When  executed,  all
                 of  text,  data, and bss will be read-write by the
                 user process.

       0410      The same as 0407 except that the start of data  is
                 rounded up to a specified boundry (current default
                 is 0x100000).  When  executed,  the  text  portion
                 will  be  read-only  and  shared  among  all users
                 executing the same file.

       0413      The executable is linked in such a manner that  it
                 can  be  directly  paged  in  off  disk by virtual
                 memory  implementations  of  Unix.   Although  not
                 ideal,  for  various reasons this is currently the
                 default file format produced by the linker.

       0414      The  same  as   0413   except   that   a   liberal
                 interpretation  of  the COFF specification is used
                 to page align the text and  data  segments  within
                 the actual executable (thus leaving "holes" in the
                 COFF  file  which  may  confuse  some  naive  COFF
                 readers).   In  addition, text and data are linked
                 in separate address spaces, both of which start at
                 one  page  boundry  up  from  address  zero.  When
                 executed, page zero of data will  be  unmapped  to


  Page 2                                                   May 1989


















  LD(1)         (Software Generation System Utilities)        LD(1)



                 catch dereferencing of NULL pointers.

       0415      The same as 0414  except  for  the  magic  number.
                 When executed, a dummy page at data address 0 will
                 be supplied by the system, so buggy programs  that
                 dereference  NULL  pointers  will  continue to run
                 without trapping.  A  simple  patch  program  will
                 turn a 0414 executable into a 0415 executable.

                 These formats may be modified slightly by  use  of
                 the  -i,  -D,  -R,  and  -T  options,  but not all
                 combinations are fully supported.

       -i        Place text and data in  separate  address  spaces.
                 The default with -i is to start both text and data
                 at  address  0,  and  suppress  complaints   about
                 address space overlap.

       -lx       Search library archive libx.a, where x is a string
                 specifying a library to be searched for unresolved
                 global symbols.  The  linker  first  searches  any
                 directories  specified  by  preceding  -L options,
                 then searches the default  directories  /lib,  and
                 /usr/lib.   Since  a  library is searched when its
                 name is encountered, the ordering  of  -l  and  -L
                 options is significant.

       -L  dir    Add  directory  dir  to  the  list   of   library
                 directories   to   search,   before   any  default
                 directories, but after any  directories  specified
                 by previous -L options.

       -o name   The output file name is set to  name  rather  than
                 the default a.out.

       -r        Perform object module coalescing only, do  not  do
                 any  relocation.   The  output module will contain
                 relocation information from all the input modules,
                 allowing  it  to  become  input for another linker
                 run.


  Page 3                                                   May 1989


















  LD(1)         (Software Generation System Utilities)        LD(1)



       -R value  This  option  has   slightly   different   effects
                 depending  upon  whether  the executable is one of
                 the non-paging formats (0407, 0410), or one of the
                 paging  formats  (0413, 0414, 0415).  For the non-
                 paging formats, set the  data  rounding  value  to
                 value.  The data base address is rounded up to the
                 next multiple of the  data  rounding  value.   For
                 paging format files, value becomes an offset added
                 to the file offset  for  the  start  of  the  data
                 section, to produce the base address of data.

       -s        Strip the relocation tables, line number  entries,
                 symbol  table,  and  string  table from the output
                 file.  This information can also be  removed  with
                 the strip(1) command.

       -S        Suppress 32-bit literal synthesis  for  the  m88k.
                 The  default  action  is to perform 32-bit literal
                 synthesis when required.

       -T base   Use base as the base address of the text  section.
                 The  address  may  be specified in octal (0nnn..),
                 hex (0Xnnn...), or decimal (nnn...).

       -u name   Enter name in the symbol  table  as  an  undefined
                 global  reference.   This  option  is  useful  for
                 loading entirely from an archive  library  because
                 an  unresolved  global  reference  is  required to
                 force loading of at least one object module.

       -v        Enable verbose mode.   Prints  the  name  of  each
                 object  module  loaded,  along with other possibly
                 useful information.

  SEE ALSO
       as(1), ar(1), cc(1), ld(1), size(1), strip(1).






  Page 4                                                   May 1989
















Typewritten Software • bear@typewritten.org • Edmonds, WA 98026