Print this page
6098 ld(1) should not require symbols which identify group sections be global

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/groups.c
          +++ new/usr/src/cmd/sgs/libld/common/groups.c
↓ open down ↓ 233 lines elided ↑ open up ↑
 234  234          /*
 235  235           * Generate a group descriptor.
 236  236           */
 237  237          gd.gd_isc = gisc;
 238  238          gd.gd_oisc = NULL;
 239  239          gd.gd_name = str;
 240  240          gd.gd_data = gisc->is_indata->d_buf;
 241  241          gd.gd_cnt = gisc->is_indata->d_size / sizeof (Word);
 242  242  
 243  243          /*
 244      -         * If this group is a COMDAT group, validate the signature symbol.
 245      -         */
 246      -        if ((gd.gd_data[0] & GRP_COMDAT) && !gnu_stt_section &&
 247      -            ((ELF_ST_BIND(sym->st_info) == STB_LOCAL) ||
 248      -            (sym->st_shndx == SHN_UNDEF))) {
 249      -                /* If section symbol, construct a printable name for it */
 250      -                if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) {
 251      -                        if (gisc->is_sym_name == NULL)
 252      -                                (void) ld_stt_section_sym_name(gisc);
 253      -
 254      -                        if (gisc->is_sym_name != NULL)
 255      -                                str = gisc->is_sym_name;
 256      -                }
 257      -
 258      -                ld_eprintf(ofl, ERR_FATAL, MSG_INTL(MSG_GRP_INVALSYM),
 259      -                    gifl->ifl_name, EC_WORD(gisc->is_scnndx),
 260      -                    gisc->is_name, str);
 261      -                return (0);
 262      -        }
 263      -
 264      -        /*
 265  244           * If the signature symbol is a name generated by the GNU compiler to
 266  245           * refer to a header, we need sloppy relocation.
 267  246           */
 268  247          if (is_header_gensym(str)) {
 269  248                  if ((ofl->ofl_flags1 & FLG_OF1_NRLXREL) == 0)
 270  249                          ofl->ofl_flags1 |= FLG_OF1_RLXREL;
 271  250                  DBG_CALL(Dbg_sec_gnu_comdat(ofl->ofl_lml, gisc, TRUE,
 272  251                      (ofl->ofl_flags1 & FLG_OF1_RLXREL) != 0));
 273  252          }
 274  253  
↓ open down ↓ 35 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX