Print this page
9139 check_rtime should be able to forbid libraries
9140 check_rtime should learn libnsl is safe now
9141 check_rtime exceptions could be cleaner

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/scripts/check_rtime.pl
          +++ new/usr/src/tools/scripts/check_rtime.pl
↓ open down ↓ 88 lines elided ↑ open up ↑
  89   89  #
  90   90  # The exceptions are:
  91   91  #
  92   92  #   EXEC_DATA
  93   93  #       Objects that are not required to have non-executable writable
  94   94  #       data segments.
  95   95  #
  96   96  #   EXEC_STACK
  97   97  #       Objects that are not required to have a non-executable stack
  98   98  #
       99 +#   FORBIDDEN_DEP
      100 +#       Objects allowed to link to 'forbidden' objects
      101 +#
      102 +#   FORBIDDEN
      103 +#       Objects to which nobody not excepted with FORBIDDEN_DEP may link
      104 +#
  99  105  #   NOCRLEALT
 100  106  #       Objects that should be skipped by AltObjectConfig() when building
 101  107  #       the crle script that maps objects to the proto area.
 102  108  #
 103  109  #    NODIRECT
 104  110  #       Objects that are not required to use direct bindings
 105  111  #
 106  112  #    NOSYMSORT
 107  113  #       Objects we should not check for duplicate addresses in
 108  114  #       the symbol sort sections.
↓ open down ↓ 22 lines elided ↑ open up ↑
 131  137  #       Objects that are allowed to have unused dependencies
 132  138  #
 133  139  #    UNUSED_OBJ
 134  140  #       Objects that are allowed to be unused dependencies
 135  141  #
 136  142  #    UNUSED_RPATH
 137  143  #       Objects with unused runpaths
 138  144  #
 139  145  
 140  146  use vars  qw($EXRE_exec_data $EXRE_exec_stack $EXRE_nocrlealt);
 141      -use vars  qw($EXRE_nodirect $EXRE_nosymsort);
      147 +use vars  qw($EXRE_nodirect $EXRE_nosymsort $EXRE_forbidden_dep $EXRE_forbidden);
 142  148  use vars  qw($EXRE_olddep $EXRE_skip $EXRE_stab $EXRE_textrel $EXRE_undef_ref);
 143  149  use vars  qw($EXRE_unref_obj $EXRE_unused_deps $EXRE_unused_obj);
 144  150  use vars  qw($EXRE_unused_rpath);
 145  151  
 146  152  use strict;
 147  153  use Getopt::Std;
 148  154  use File::Basename;
 149  155  
 150  156  
 151  157  # Reliably compare two OS revisions.  Arguments are <ver1> <op> <ver2>.
↓ open down ↓ 284 lines elided ↑ open up ↑
 436  442                          next if defined($EXRE_unused_rpath) &&
 437  443                              ($Line =~ $EXRE_unused_rpath);
 438  444  
 439  445                          if ($Secure) {
 440  446                                  $Line =~ s!$Tmpdir/!!;
 441  447                          }
 442  448                          $Line =~ s/^[ \t]*(.*)/\t$1\t<remove search path?>/;
 443  449                          onbld_elfmod::OutMsg($ErrFH, $ErrTtl, $RelPath, $Line);
 444  450                          next;
 445  451                  }
      452 +                
 446  453                  # Look for unreferenced dependencies.  Note, if any unreferenced
 447  454                  # objects are ignored, then set $UnDep so as to suppress any
 448  455                  # associated unused-object messages.
 449  456                  if ($Line =~ /unreferenced object=/) {
 450  457                          if (defined($EXRE_unref_obj) &&
 451  458                              ($Line =~ $EXRE_unref_obj)) {
 452  459                                  $UnDep = 0;
 453  460                                  next;
 454  461                          }
 455  462                          if ($Secure) {
↓ open down ↓ 114 lines elided ↑ open up ↑
 570  577                          next;
 571  578                  }
 572  579  
 573  580                  # Does this object have any dependencies.
 574  581                  if ($Line =~ /NEEDED/) {
 575  582                          my($Need) = (split(' ', $Line))[3];
 576  583  
 577  584                          if (defined($EXRE_olddep) && ($Need =~ $EXRE_olddep)) {
 578  585                                  # Catch any old (unnecessary) dependencies.
 579  586                                  onbld_elfmod::OutMsg($ErrFH, $ErrTtl, $RelPath,
 580      -                        "NEEDED=$Need\t<dependency no longer necessary>");
      587 +                                    "NEEDED=$Need\t<dependency no " .
      588 +                                    "longer necessary>");
      589 +                        } elsif (defined($EXRE_forbidden) && 
      590 +                            ($Need =~ $EXRE_forbidden)) {
      591 +                                next if defined($EXRE_forbidden_dep) &&
      592 +                                    ($FullPath =~ $EXRE_forbidden_dep);
      593 +
      594 +                                onbld_elfmod::OutMsg($ErrFH, $ErrTtl, $RelPath, 
      595 +                                    "NEEDED=$Need\t<forbidden dependency, " .
      596 +                                    "missing -nodefaultlibs?>");
      597 +                                next;
 581  598                          } elsif ($opt{i}) {
 582  599                                  # Under the -i (information) option print out
 583  600                                  # any useful dynamic entries.
 584  601                                  onbld_elfmod::OutMsg($InfoFH, $InfoTtl, $RelPath,
 585  602                                      "NEEDED=$Need");
 586      -                        }
      603 +                        }
 587  604                          next;
 588  605                  }
 589  606  
 590  607                  # Is this object built with -B direct flag on?
 591  608                  if ($Line =~ / DIRECT /) {
 592  609                          $HasDirectBinding = 1;
 593  610                  }
 594  611  
 595  612                  # Does this object specify a runpath.
 596  613                  if ($opt{i} && ($Line =~ /RPATH/)) {
↓ open down ↓ 593 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX