Print this page
7319 Need a way to turn off ld "multiple inclusion" warnings
Reviewed by: Martin Bochnig <opensxce@mail.ru>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/files.c
          +++ new/usr/src/cmd/sgs/libld/common/files.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  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   27   * Copyright (c) 2012, Joyent, Inc. All rights reserved.
       28 + * Copyright 2016 RackTop Systems.
  28   29   */
  29   30  
  30   31  /*
  31   32   * Processing of relocatable objects and shared objects.
  32   33   */
  33   34  
  34   35  #define ELF_TARGET_AMD64
  35   36  #define ELF_TARGET_SPARC
  36   37  
  37   38  #include        <stdio.h>
↓ open down ↓ 3195 lines elided ↑ open up ↑
3233 3234                                  (void) elf_end(elf);
3234 3235  
3235 3236                                  /*
3236 3237                                   * If the file was explicitly defined on the
3237 3238                                   * command line (this is always the case for
3238 3239                                   * relocatable objects, and is true for shared
3239 3240                                   * objects when they weren't specified via -l or
3240 3241                                   * were dragged in as an implicit dependency),
3241 3242                                   * then warn the user.
3242 3243                                   */
3243      -                                if ((flags & FLG_IF_CMDLINE) ||
3244      -                                    (ifl->ifl_flags & FLG_IF_CMDLINE)) {
     3244 +                                if (((flags & FLG_IF_CMDLINE) ||
     3245 +                                    (ifl->ifl_flags & FLG_IF_CMDLINE)) &&
     3246 +                                    !(ofl->ofl_flags & FLG_OF_MULINCL)) {
3245 3247                                          const char      *errmsg;
3246 3248  
3247 3249                                          /*
3248 3250                                           * Determine whether this is the same
3249 3251                                           * file name as originally encountered
3250 3252                                           * so as to provide the most
3251 3253                                           * descriptive diagnostic.
3252 3254                                           */
3253 3255                                          errmsg =
3254 3256                                              (strcmp(name, ifl->ifl_name) == 0) ?
↓ open down ↓ 470 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX