Print this page
4843 add --as-needed and --no-as-needed to ld

@@ -458,25 +458,35 @@
                         break;
                 case '-':
                         switch (*(arg + 1)) {
                         case 'a':
                                 /*
+                                 * Translate --as-needed to -zignore
+                                 */
+                                if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
+                                    MSG_ORIG(MSG_ARG_T_ASNEEDED), 0, NULL)) !=
+                                    0) {
+                                        optarg =
+                                            (char *)MSG_ORIG(MSG_ARG_IGNORE);
+                                        return (c);
+                                }
+                                /*
                                  * Translate --allow-multiple-definition to
                                  * -zmuldefs
                                  */
                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
                                     MSG_ORIG(MSG_ARG_T_MULDEFS), 0, NULL)) !=
                                     0) {
                                         optarg =
                                             (char *)MSG_ORIG(MSG_ARG_MULDEFS);
                                         return (c);
-
+                                }
                                 /*
                                  * Translate --auxiliary <optarg> to
                                  * -f <optarg>
                                  */
-                                } else if ((c = str2chr(lml, argc, ndx, argv,
+                                if ((c = str2chr(lml, argc, ndx, argv,
                                     arg, 'f', MSG_ORIG(MSG_ARG_T_AUXFLTR),
                                     MSG_ARG_T_AUXFLTR_SIZE, NULL)) != 0) {
                                         return (c);
                                 }
                                 break;

@@ -556,10 +566,20 @@
                                         return (c);
                                 }
                                 break;
                         case 'n':
                                 /*
+                                 * Translate --no-as-needed to -zrecord
+                                 */
+                                if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
+                                    MSG_ORIG(MSG_ARG_T_NOASNEEDED), 0, NULL)) !=
+                                    0) {
+                                        optarg =
+                                            (char *)MSG_ORIG(MSG_ARG_RECORD);
+                                        return (c);
+                                }
+                                /*
                                  * Translate --no-fatal-warnings to
                                  * -z nofatal-warnings.
                                  */
                                 if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
                                     MSG_ORIG(MSG_ARG_T_NOFATWARN),