Print this page
12314 ld fatal warnings miss some guidance messages

@@ -22,10 +22,12 @@
 /*
  *      Copyright (c) 1988 AT&T
  *        All Rights Reserved
  *
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+ *
+ * Copyright 2020 Joyent, Inc.
  */
 
 /*
  * Processing of relocatable objects and shared objects.
  */

@@ -478,14 +480,24 @@
          * Wrap up debug output file if one is open
          */
         dbg_cleanup();
 
         /* If any ERR_GUIDANCE messages were issued, add a summary */
-        if (ofl->ofl_guideflags & FLG_OFG_ISSUED)
+        if (ofl->ofl_guideflags & FLG_OFG_ISSUED) {
                 ld_eprintf(ofl, ERR_GUIDANCE, MSG_INTL(MSG_GUIDE_SUMMARY));
+                ofl->ofl_guideflags &= ~FLG_OFG_ISSUED;
+        }
 
         /*
+         * One final check for any new warnings we found that should fail the
+         * link edit.
+         */
+        if ((ofl->ofl_flags & (FLG_OF_WARN | FLG_OF_FATWARN)) ==
+            (FLG_OF_WARN | FLG_OF_FATWARN))
+                return (ld_exit(ofl));
+
+        /*
          * For performance reasons we don't actually free up the memory we've
          * allocated, it will be freed when we exit.
          *
          * But the below line can be uncommented if/when we want to measure how
          * our memory consumption and freeing are doing.  We should be able to