Print this page
3453 GNU comdat redirection does exactly the wrong thing

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/place.c
          +++ new/usr/src/cmd/sgs/libld/common/place.c
↓ open down ↓ 317 lines elided ↑ open up ↑
 318  318                      (isp == gisp) || (isp->is_name == NULL))
 319  319                          continue;
 320  320  
 321  321                  /*
 322  322                   * It's questionable whether this size should be cached in the
 323  323                   * Is_desc.  However, this seems an infrequent operation and
 324  324                   * adding Is_desc members can escalate memory usage for large
 325  325                   * link-edits.  For now, size the section name dynamically.
 326  326                   */
 327  327                  ssize = strlen(isp->is_name);
 328      -                if ((strncmp(isp->is_name, gisp->is_name, ssize) != 0) &&
      328 +                if ((strncmp(isp->is_name, gisp->is_name, ssize) == 0) &&
 329  329                      (gisp->is_name[ssize] == '.'))
 330  330                          return ((char *)&gisp->is_name[ssize]);
 331  331          }
 332  332          return (NULL);
 333  333  }
 334  334  
 335  335  /*
 336  336   * GNU .gnu.linkonce sections follow a naming convention that indicates the
 337  337   * required association with an output section.  Determine whether this input
 338  338   * section follows the convention, and if so return the appropriate output
↓ open down ↓ 917 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX