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


 224          *      section.
 225          *
 226          * In order to support such objects, we do the same.
 227          */
 228         gnu_stt_section = ((sym->st_name == 0) || (*str == '\0')) &&
 229             (ELF_ST_TYPE(sym->st_info) == STT_SECTION);
 230         if (gnu_stt_section)
 231                 str = gisc->is_name;
 232 
 233 
 234         /*
 235          * Generate a group descriptor.
 236          */
 237         gd.gd_isc = gisc;
 238         gd.gd_oisc = NULL;
 239         gd.gd_name = str;
 240         gd.gd_data = gisc->is_indata->d_buf;
 241         gd.gd_cnt = gisc->is_indata->d_size / sizeof (Word);
 242 
 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          * If the signature symbol is a name generated by the GNU compiler to
 266          * refer to a header, we need sloppy relocation.
 267          */
 268         if (is_header_gensym(str)) {
 269                 if ((ofl->ofl_flags1 & FLG_OF1_NRLXREL) == 0)
 270                         ofl->ofl_flags1 |= FLG_OF1_RLXREL;
 271                 DBG_CALL(Dbg_sec_gnu_comdat(ofl->ofl_lml, gisc, TRUE,
 272                     (ofl->ofl_flags1 & FLG_OF1_RLXREL) != 0));
 273         }
 274 
 275         /*
 276          * Validate the section indices within the group.  If this is a COMDAT
 277          * group, mark each section as COMDAT.
 278          */
 279         for (ndx = 1; ndx < gd.gd_cnt; ndx++) {
 280                 Word    gndx;
 281 
 282                 if ((gndx = gd.gd_data[ndx]) >= gifl->ifl_shnum) {
 283                         ld_eprintf(ofl, ERR_FATAL,
 284                             MSG_INTL(MSG_GRP_INVALNDX), gifl->ifl_name,




 224          *      section.
 225          *
 226          * In order to support such objects, we do the same.
 227          */
 228         gnu_stt_section = ((sym->st_name == 0) || (*str == '\0')) &&
 229             (ELF_ST_TYPE(sym->st_info) == STT_SECTION);
 230         if (gnu_stt_section)
 231                 str = gisc->is_name;
 232 
 233 
 234         /*
 235          * Generate a group descriptor.
 236          */
 237         gd.gd_isc = gisc;
 238         gd.gd_oisc = NULL;
 239         gd.gd_name = str;
 240         gd.gd_data = gisc->is_indata->d_buf;
 241         gd.gd_cnt = gisc->is_indata->d_size / sizeof (Word);
 242 
 243         /*





















 244          * If the signature symbol is a name generated by the GNU compiler to
 245          * refer to a header, we need sloppy relocation.
 246          */
 247         if (is_header_gensym(str)) {
 248                 if ((ofl->ofl_flags1 & FLG_OF1_NRLXREL) == 0)
 249                         ofl->ofl_flags1 |= FLG_OF1_RLXREL;
 250                 DBG_CALL(Dbg_sec_gnu_comdat(ofl->ofl_lml, gisc, TRUE,
 251                     (ofl->ofl_flags1 & FLG_OF1_RLXREL) != 0));
 252         }
 253 
 254         /*
 255          * Validate the section indices within the group.  If this is a COMDAT
 256          * group, mark each section as COMDAT.
 257          */
 258         for (ndx = 1; ndx < gd.gd_cnt; ndx++) {
 259                 Word    gndx;
 260 
 261                 if ((gndx = gd.gd_data[ndx]) >= gifl->ifl_shnum) {
 262                         ld_eprintf(ofl, ERR_FATAL,
 263                             MSG_INTL(MSG_GRP_INVALNDX), gifl->ifl_name,