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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/util.c
          +++ new/usr/src/cmd/sgs/libld/common/util.c
↓ open down ↓ 452 lines elided ↑ open up ↑
 453  453                              arg, 'z', MSG_ORIG(MSG_ARG_T_CPAR), 0, NULL)) !=
 454  454                              0) {
 455  455                                  optarg = (char *)MSG_ORIG(MSG_ARG_RESCAN_END);
 456  456                                  return (c);
 457  457                          }
 458  458                          break;
 459  459                  case '-':
 460  460                          switch (*(arg + 1)) {
 461  461                          case 'a':
 462  462                                  /*
      463 +                                 * Translate --as-needed to -zignore
      464 +                                 */
      465 +                                if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
      466 +                                    MSG_ORIG(MSG_ARG_T_ASNEEDED), 0, NULL)) !=
      467 +                                    0) {
      468 +                                        optarg =
      469 +                                            (char *)MSG_ORIG(MSG_ARG_IGNORE);
      470 +                                        return (c);
      471 +                                }
      472 +                                /*
 463  473                                   * Translate --allow-multiple-definition to
 464  474                                   * -zmuldefs
 465  475                                   */
 466  476                                  if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 467  477                                      MSG_ORIG(MSG_ARG_T_MULDEFS), 0, NULL)) !=
 468  478                                      0) {
 469  479                                          optarg =
 470  480                                              (char *)MSG_ORIG(MSG_ARG_MULDEFS);
 471  481                                          return (c);
 472      -
      482 +                                }
 473  483                                  /*
 474  484                                   * Translate --auxiliary <optarg> to
 475  485                                   * -f <optarg>
 476  486                                   */
 477      -                                } else if ((c = str2chr(lml, argc, ndx, argv,
      487 +                                if ((c = str2chr(lml, argc, ndx, argv,
 478  488                                      arg, 'f', MSG_ORIG(MSG_ARG_T_AUXFLTR),
 479  489                                      MSG_ARG_T_AUXFLTR_SIZE, NULL)) != 0) {
 480  490                                          return (c);
 481  491                                  }
 482  492                                  break;
 483  493                          case 'd':
 484  494                                  /*
 485  495                                   * Translate --dynamic-linker <optarg> to
 486  496                                   * -I <optarg>
 487  497                                   */
↓ open down ↓ 63 lines elided ↑ open up ↑
 551  561                                   * -L <optarg>
 552  562                                   */
 553  563                                  } else if ((c = str2chr(lml, ndx, argc, argv,
 554  564                                      arg, 'L', MSG_ORIG(MSG_ARG_T_LIBPATH),
 555  565                                      MSG_ARG_T_LIBPATH_SIZE, NULL)) != 0) {
 556  566                                          return (c);
 557  567                                  }
 558  568                                  break;
 559  569                          case 'n':
 560  570                                  /*
      571 +                                 * Translate --no-as-needed to -zrecord
      572 +                                 */
      573 +                                if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
      574 +                                    MSG_ORIG(MSG_ARG_T_NOASNEEDED), 0, NULL)) !=
      575 +                                    0) {
      576 +                                        optarg =
      577 +                                            (char *)MSG_ORIG(MSG_ARG_RECORD);
      578 +                                        return (c);
      579 +                                }
      580 +                                /*
 561  581                                   * Translate --no-fatal-warnings to
 562  582                                   * -z nofatal-warnings.
 563  583                                   */
 564  584                                  if ((c = str2chr(lml, ndx, argc, argv, arg, 'z',
 565  585                                      MSG_ORIG(MSG_ARG_T_NOFATWARN),
 566  586                                      0, NULL)) != 0) {
 567  587                                          optarg = (char *)
 568  588                                              MSG_ORIG(MSG_ARG_NOFATWARN);
 569  589                                          return (c);
 570  590                                  }
↓ open down ↓ 200 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX