1 #
   2 # CDDL HEADER START
   3 #
   4 # The contents of this file are subject to the terms of the
   5 # Common Development and Distribution License, Version 1.0 only
   6 # (the "License").  You may not use this file except in compliance
   7 # with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 #
  23 # Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # ident "%Z%%M% %I%     %E% SMI"
  27 #
  28         In order to determine which object files aren't used in building the
  29 standalone boot applications, first build the standalone libraries
  30 
  31         $ cd $SRC/stand/lib ; make install
  32 
  33 Next, collect some information from the linking process:
  34 
  35         $ cd $SRC/psm/stand/boot/`uname -p`/`uname -m`
  36         $ rm -f *.bin *boot *boot.elf
  37         $ LD_OPTIONS="-Dbindings,files,symbols" make all > /dev/null 2> ld.debug
  38 
  39 The following sort of information ends up in ld.debug (note that the debugging
  40 output from the link-editor is not considered a 'stable interface' and may
  41 change in the future):
  42 
  43         debug: 
  44         debug: file=/.../proto/root_sparc/stand/lib/libcrypto.a(cryptlib.o)  [ ET_REL ]
  45         debug: 
  46         debug: symbol table processing; input file=/.../proto/root_sparc/stand/lib/libcrypto.a(cryptlib.o)  [ ET_REL ]
  47         debug: symbol[1]=cryptlib.c
  48         ...
  49 
  50 Now run the following script
  51 
  52         #!/bin/sh -
  53 
  54         for obj in      $SRC/stand/lib/crypto/objs/*.o  \
  55                         $SRC/stand/lib/fs/*/objs/*.o    \
  56                         $SRC/stand/lib/sa/objs/*.o      \
  57                         $SRC/stand/lib/ssl/objs/*.o     \
  58                         $SRC/stand/lib/wanboot/objs/*.o
  59         do
  60                 f=`basename $obj`
  61                 if egrep "^debug: file=.*\($f\)" ld.debug > /dev/null
  62                 then
  63                         :
  64                 else
  65                         echo $obj
  66                 fi
  67         done
  68 
  69 to determine which of the .o files appears in none of the loader debug output
  70 (and therefore is unused).