/* Optional information about a COMDAT entry; NULL if not COMDAT. */
struct coff_comdat_info *comdat;
int line_base;
- /* A pointer used for .stab linking optimizations. */
- void * stab_info;
/* Available for individual backends. */
void * tdata;
};
|| (stab->name[5] == '.' && ISDIGIT (stab->name[6]))))
{
struct coff_link_hash_table *table;
- struct coff_section_tdata *secdata
- = coff_section_data (abfd, stab);
-
- if (secdata == NULL)
- {
- amt = sizeof (struct coff_section_tdata);
- stab->used_by_bfd = bfd_zalloc (abfd, amt);
- if (stab->used_by_bfd == NULL)
- goto error_return;
- secdata = coff_section_data (abfd, stab);
- }
table = coff_hash_table (info);
if (! _bfd_link_section_stabs (abfd, &table->stab_info,
stab, stabstr,
- &secdata->stab_info,
&string_offset))
goto error_return;
}
}
/* Write out the modified section contents. */
- if (secdata == NULL || secdata->stab_info == NULL)
+ if (o->sec_info_type != SEC_INFO_TYPE_STABS)
{
file_ptr loc = (o->output_offset
* bfd_octets_per_byte (output_bfd, o));
{
if (! (_bfd_write_section_stabs
(output_bfd, &coff_hash_table (flaginfo->info)->stab_info,
- o, &secdata->stab_info, contents)))
+ o, contents)))
return false;
}
}
switch (sec->sec_info_type)
{
case SEC_INFO_TYPE_STABS:
- return _bfd_stab_section_offset (sec, sec->sec_info, offset);
+ return _bfd_stab_section_offset (sec, offset);
case SEC_INFO_TYPE_EH_FRAME:
return _bfd_elf_eh_frame_section_offset (abfd, info, sec, offset);
&& (!stab->name[5] ||
(stab->name[5] == '.' && ISDIGIT (stab->name[6])))
&& (stab->flags & SEC_MERGE) == 0
- && !bfd_is_abs_section (stab->output_section))
- {
- if (! _bfd_link_section_stabs (abfd, &htab->stab_info, stab,
- stabstr, &stab->sec_info,
- &string_offset))
- goto error_return;
- if (stab->sec_info)
- stab->sec_info_type = SEC_INFO_TYPE_STABS;
- }
+ && !bfd_is_abs_section (stab->output_section)
+ && !_bfd_link_section_stabs (abfd, &htab->stab_info, stab,
+ stabstr, &string_offset))
+ goto error_return;
}
}
case SEC_INFO_TYPE_STABS:
if (! (_bfd_write_section_stabs
(output_bfd,
- &elf_hash_table (flinfo->info)->stab_info,
- o, &o->sec_info, contents)))
+ &elf_hash_table (flinfo->info)->stab_info, o, contents)))
return false;
break;
case SEC_INFO_TYPE_MERGE:
if (!init_reloc_cookie_for_section (&cookie, info, i, false))
return -1;
- if (_bfd_discard_section_stabs (abfd, i, i->sec_info,
+ if (_bfd_discard_section_stabs (abfd, i,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
changed = 1;
/* Extracted from stabs.c. */
bool _bfd_link_section_stabs
- (bfd *, struct stab_info *, asection *, asection *, void **,
+ (bfd *, struct stab_info *, asection *, asection *,
bfd_size_type *) ATTRIBUTE_HIDDEN;
bool _bfd_discard_section_stabs
- (bfd *, asection *, void *, bool (*) (bfd_vma, void *), void *) ATTRIBUTE_HIDDEN;
+ (bfd *, asection *, bool (*) (bfd_vma, void *), void *) ATTRIBUTE_HIDDEN;
bool _bfd_write_section_stabs
- (bfd *, struct stab_info *, asection *, void **, bfd_byte *) ATTRIBUTE_HIDDEN;
+ (bfd *, struct stab_info *, asection *, bfd_byte *) ATTRIBUTE_HIDDEN;
bool _bfd_write_stab_strings (bfd *, struct stab_info *) ATTRIBUTE_HIDDEN;
-bfd_vma _bfd_stab_section_offset (asection *, void *, bfd_vma) ATTRIBUTE_HIDDEN;
+bfd_vma _bfd_stab_section_offset (asection *, bfd_vma) ATTRIBUTE_HIDDEN;
/* Extracted from targets.c. */
#ifdef __cplusplus
struct stab_info *sinfo,
asection *stabsec,
asection *stabstrsec,
- void * *psecinfo,
bfd_size_type *pstring_offset)
{
bool first;
amt = sizeof (struct stab_section_info);
amt += (count - 1) * sizeof (bfd_size_type);
- *psecinfo = bfd_alloc (abfd, amt);
- if (*psecinfo == NULL)
+ secinfo = bfd_alloc (abfd, amt);
+ if (secinfo == NULL)
goto error_return;
- secinfo = (struct stab_section_info *) *psecinfo;
+ stabsec->sec_info = secinfo;
+ stabsec->sec_info_type = SEC_INFO_TYPE_STABS;
secinfo->excls = NULL;
stabsec->rawsize = stabsec->size;
secinfo->cumulative_skips = NULL;
bool
_bfd_discard_section_stabs (bfd *abfd,
asection *stabsec,
- void * psecinfo,
bool (*reloc_symbol_deleted_p) (bfd_vma, void *),
void * cookie)
{
/* We should have initialized our data in _bfd_link_section_stabs.
If there was some bizarre error reading the string sections, though,
we might not have. Bail rather than asserting. */
- if (psecinfo == NULL)
+ if (stabsec->sec_info_type != SEC_INFO_TYPE_STABS)
return false;
count = stabsec->rawsize / STABSIZE;
- secinfo = (struct stab_section_info *) psecinfo;
+ secinfo = stabsec->sec_info;
/* Read the stabs information from abfd. */
if (!bfd_malloc_and_get_section (abfd, stabsec, &stabbuf))
_bfd_write_section_stabs (bfd *output_bfd,
struct stab_info *sinfo,
asection *stabsec,
- void * *psecinfo,
bfd_byte *contents)
{
- struct stab_section_info *secinfo;
+ struct stab_section_info *secinfo = stabsec->sec_info;
struct stab_excl_list *e;
bfd_byte *sym, *tosym, *symend;
bfd_size_type *pstridx;
- secinfo = (struct stab_section_info *) *psecinfo;
-
- if (secinfo == NULL)
+ if (stabsec->sec_info_type != SEC_INFO_TYPE_STABS)
return bfd_set_section_contents (output_bfd, stabsec->output_section,
contents, stabsec->output_offset,
stabsec->size);
bfd_vma
_bfd_stab_section_offset (asection *stabsec,
- void * psecinfo,
bfd_vma offset)
{
- struct stab_section_info *secinfo;
-
- secinfo = (struct stab_section_info *) psecinfo;
+ struct stab_section_info *secinfo = stabsec->sec_info;
- if (secinfo == NULL)
+ if (stabsec->sec_info_type != SEC_INFO_TYPE_STABS)
return offset;
if (offset >= stabsec->rawsize)