aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a76e8e3..7b03754 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -28,7 +28,6 @@
#include "libiberty.h"
#include "objalloc.h"
#if BFD_SUPPORTS_PLUGINS
-#include "plugin-api.h"
#include "plugin.h"
#endif
@@ -2381,7 +2380,7 @@ elf_link_add_glibc_verneed (struct elf_find_verdep_info *rinfo,
void
_bfd_elf_link_add_glibc_version_dependency
(struct elf_find_verdep_info *rinfo,
- const char *version_dep[])
+ const char *const version_dep[])
{
Elf_Internal_Verneed *t = NULL;
int glibc_minor_base = INT_MAX;
@@ -2406,7 +2405,7 @@ _bfd_elf_link_add_dt_relr_dependency (struct elf_find_verdep_info *rinfo)
{
if (rinfo->info->enable_dt_relr)
{
- const char *version[] =
+ static const char *const version[] =
{
"GLIBC_ABI_DT_RELR",
NULL
@@ -6290,8 +6289,8 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
continue;
/* In the pre-LTO-plugin pass we must not mistakenly
- include this archive member if an earlier BFD
- defined this symbol. */
+ include this archive member if an earlier shared
+ library defined this symbol. */
struct elf_link_hash_table *htab = elf_hash_table (info);
if (htab->first_hash)
{
@@ -6299,7 +6298,9 @@ elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
= ((struct elf_link_first_hash_entry *)
bfd_hash_lookup (htab->first_hash, symdef->name,
false, false));
- if (e && e->abfd != abfd)
+ if (e
+ && (e->abfd->flags & DYNAMIC) != 0
+ && e->abfd != abfd)
continue;
}
}
@@ -11291,7 +11292,7 @@ _bfd_elf_default_action_discarded (asection *sec)
&& strncmp (sec->name, ".eh_frame.", 10) == 0)
return 0;
- if (strcmp (".sframe", sec->name) == 0)
+ if (elf_section_type (sec) == SHT_GNU_SFRAME)
return 0;
if (strcmp (".gcc_except_table", sec->name) == 0)
@@ -12230,9 +12231,9 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
break;
case SEC_INFO_TYPE_SFRAME:
{
- /* Merge .sframe sections into the ctf frame encoder
- context of the output_bfd's section. The final .sframe
- output section will be written out later. */
+ /* Merge SFrame section into the SFrame encoder context of the
+ output_bfd's section. The final .sframe output section will
+ be written out later. */
if (!_bfd_elf_merge_section_sframe (output_bfd, flinfo->info,
o, contents))
return false;
@@ -14056,7 +14057,7 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec,
h = get_ext_sym_hash_from_cookie (cookie, r_symndx);
if (h == NULL)
{
- /* A corrup tinput file can lead to a situation where the index
+ /* A corrupt input file can lead to a situation where the index
does not reference either a local or an external symbol. */
if (r_symndx >= cookie->locsymcount)
return NULL;
@@ -14408,7 +14409,8 @@ elf_gc_sweep (bfd *abfd, struct bfd_link_info *info)
if (o->flags & SEC_GROUP)
{
asection *first = elf_next_in_group (o);
- o->gc_mark = first->gc_mark;
+ if (first != NULL)
+ o->gc_mark = first->gc_mark;
}
if (o->gc_mark)