/* ELF linking support for BFD.
Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* Silently discard TLS symbols from --just-syms. There's no way to
combine a static TLS block with a new TLS block for this executable. */
if (ELF_ST_TYPE (sym->st_info) == STT_TLS
- && sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+ && sec->sec_info_type == SEC_INFO_TYPE_JUST_SYMS)
{
*skip = TRUE;
return TRUE;
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& ((sec = h->root.u.def.section)->flags & SEC_MERGE)
- && sec->sec_info_type == ELF_INFO_TYPE_MERGE)
+ && sec->sec_info_type == SEC_INFO_TYPE_MERGE)
{
bfd *output_bfd = (bfd *) data;
/* ld --just-symbols and dynamic objects don't mix very well.
ld shouldn't allow it. */
if ((s = abfd->sections) != NULL
- && s->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
+ && s->sec_info_type == SEC_INFO_TYPE_JUST_SYMS)
abort ();
/* If this dynamic lib was specified on the command line with
sec = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (sec == NULL)
sec = bfd_abs_section_ptr;
- else if (elf_discarded_section (sec))
+ else if (discarded_section (sec))
{
/* Symbols from discarded section are undefined. We keep
its visibility. */
&string_offset))
goto error_return;
if (secdata->sec_info)
- stab->sec_info_type = ELF_INFO_TYPE_STABS;
+ stab->sec_info_type = SEC_INFO_TYPE_STABS;
}
}
}
return TRUE;
}
\f
-/* Indicate that we are only retrieving symbol values from this
- section. */
-
-void
-_bfd_elf_link_just_syms (asection *sec, struct bfd_link_info *info)
-{
- if (is_elf_hash_table (info->hash))
- sec->sec_info_type = ELF_INFO_TYPE_JUST_SYMS;
- _bfd_generic_link_just_syms (sec, info);
-}
-
/* Make sure sec_info_type is cleared if sec_info is cleared too. */
static void
merge_sections_remove_hook (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec)
{
- BFD_ASSERT (sec->sec_info_type == ELF_INFO_TYPE_MERGE);
- sec->sec_info_type = ELF_INFO_TYPE_NONE;
+ BFD_ASSERT (sec->sec_info_type == SEC_INFO_TYPE_MERGE);
+ sec->sec_info_type = SEC_INFO_TYPE_NONE;
}
/* Finish SHF_MERGE section merging. */
sec, &secdata->sec_info))
return FALSE;
else if (secdata->sec_info)
- sec->sec_info_type = ELF_INFO_TYPE_MERGE;
+ sec->sec_info_type = SEC_INFO_TYPE_MERGE;
}
if (elf_hash_table (info)->merge_info != NULL)
else if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& ((finfo->info->strip_discarded
- && elf_discarded_section (h->root.u.def.section))
+ && discarded_section (h->root.u.def.section))
|| (h->root.u.def.section->owner != NULL
&& (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)))
strip = TRUE;
switch (sec->sec_info_type)
{
- case ELF_INFO_TYPE_STABS:
- case ELF_INFO_TYPE_EH_FRAME:
+ case SEC_INFO_TYPE_STABS:
+ case SEC_INFO_TYPE_EH_FRAME:
return TRUE;
default:
break;
*ppsection = NULL;
continue;
}
- else if (isec->sec_info_type == ELF_INFO_TYPE_MERGE
+ else if (isec->sec_info_type == SEC_INFO_TYPE_MERGE
&& ELF_ST_TYPE (isym->st_info) != STT_SECTION)
isym->st_value =
_bfd_merged_section_offset (output_bfd, &isec,
{
/* Complain if the definition comes from a
discarded section. */
- if ((sec = *ps) != NULL && elf_discarded_section (sec))
+ if ((sec = *ps) != NULL && discarded_section (sec))
{
BFD_ASSERT (r_symndx != STN_UNDEF);
if (action_discarded & COMPLAIN)
}
else switch (o->sec_info_type)
{
- case ELF_INFO_TYPE_STABS:
+ case SEC_INFO_TYPE_STABS:
if (! (_bfd_write_section_stabs
(output_bfd,
&elf_hash_table (finfo->info)->stab_info,
o, &elf_section_data (o)->sec_info, contents)))
return FALSE;
break;
- case ELF_INFO_TYPE_MERGE:
+ case SEC_INFO_TYPE_MERGE:
if (! _bfd_write_merged_section (output_bfd, o,
elf_section_data (o)->sec_info))
return FALSE;
break;
- case ELF_INFO_TYPE_EH_FRAME:
+ case SEC_INFO_TYPE_EH_FRAME:
{
if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info,
o, contents))
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
- && elf_discarded_section (h->root.u.def.section))
+ && discarded_section (h->root.u.def.section))
return TRUE;
else
return FALSE;
/* Need to: get the symbol; get the section. */
isym = &rcookie->locsyms[r_symndx];
isec = bfd_section_from_elf_index (rcookie->abfd, isym->st_shndx);
- if (isec != NULL && elf_discarded_section (isec))
+ if (isec != NULL && discarded_section (isec))
return TRUE;
}
return FALSE;
if (stab != NULL
&& (stab->size == 0
|| bfd_is_abs_section (stab->output_section)
- || stab->sec_info_type != ELF_INFO_TYPE_STABS))
+ || stab->sec_info_type != SEC_INFO_TYPE_STABS))
stab = NULL;
if (stab == NULL