Print this page
12314 ld fatal warnings miss some guidance messages

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/ldmain.c
          +++ new/usr/src/cmd/sgs/libld/common/ldmain.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   *      Copyright (c) 1988 AT&T
  24   24   *        All Rights Reserved
  25   25   *
  26   26   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
       27 + *
       28 + * Copyright 2020 Joyent, Inc.
  27   29   */
  28   30  
  29   31  /*
  30   32   * Processing of relocatable objects and shared objects.
  31   33   */
  32   34  
  33   35  /*
  34   36   * ld -- link/editor main program
  35   37   */
  36   38  #include        <sys/types.h>
↓ open down ↓ 436 lines elided ↑ open up ↑
 473  475  
 474  476          DBG_CALL(Dbg_statistics_ld(ofl));
 475  477          DBG_CALL(Dbg_basic_finish(ofl->ofl_lml));
 476  478  
 477  479          /*
 478  480           * Wrap up debug output file if one is open
 479  481           */
 480  482          dbg_cleanup();
 481  483  
 482  484          /* If any ERR_GUIDANCE messages were issued, add a summary */
 483      -        if (ofl->ofl_guideflags & FLG_OFG_ISSUED)
      485 +        if (ofl->ofl_guideflags & FLG_OFG_ISSUED) {
 484  486                  ld_eprintf(ofl, ERR_GUIDANCE, MSG_INTL(MSG_GUIDE_SUMMARY));
      487 +                ofl->ofl_guideflags &= ~FLG_OFG_ISSUED;
      488 +        }
 485  489  
 486  490          /*
      491 +         * One final check for any new warnings we found that should fail the
      492 +         * link edit.
      493 +         */
      494 +        if ((ofl->ofl_flags & (FLG_OF_WARN | FLG_OF_FATWARN)) ==
      495 +            (FLG_OF_WARN | FLG_OF_FATWARN))
      496 +                return (ld_exit(ofl));
      497 +
      498 +        /*
 487  499           * For performance reasons we don't actually free up the memory we've
 488  500           * allocated, it will be freed when we exit.
 489  501           *
 490  502           * But the below line can be uncommented if/when we want to measure how
 491  503           * our memory consumption and freeing are doing.  We should be able to
 492  504           * free all the memory that has been allocated as part of the link-edit
 493  505           * process.
 494  506           */
 495  507          /* ld_ofl_cleanup(ofl); */
 496  508          return (0);
↓ open down ↓ 66 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX