mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-10 09:35:24 +08:00
* elflink.h: Formatting fixes, tidy prototypes.
(elf_link_assign_sym_version): Move common code out of loop.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2002-07-16 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elflink.h: Formatting fixes, tidy prototypes.
|
||||||
|
(elf_link_assign_sym_version): Move common code out of loop.
|
||||||
|
|
||||||
2002-07-16 Alan Modra <amodra@bigpond.net.au>
|
2002-07-16 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
|
* elflink.h (elf_link_input_bfd): Don't call reloc_emitter when
|
||||||
|
@ -2852,7 +2852,7 @@ compute_bucket_count (info)
|
|||||||
elf_link_hash_traverse (elf_hash_table (info),
|
elf_link_hash_traverse (elf_hash_table (info),
|
||||||
elf_collect_hash_codes, &hashcodesp);
|
elf_collect_hash_codes, &hashcodesp);
|
||||||
|
|
||||||
/* We have a problem here. The following code to optimize the table
|
/* We have a problem here. The following code to optimize the table
|
||||||
size requires an integer type with more the 32 bits. If
|
size requires an integer type with more the 32 bits. If
|
||||||
BFD_HOST_U_64_BIT is set we know about such a type. */
|
BFD_HOST_U_64_BIT is set we know about such a type. */
|
||||||
#ifdef BFD_HOST_U_64_BIT
|
#ifdef BFD_HOST_U_64_BIT
|
||||||
@ -4088,7 +4088,7 @@ elf_export_symbol (h, data)
|
|||||||
|
|
||||||
if (!eif->verdefs)
|
if (!eif->verdefs)
|
||||||
{
|
{
|
||||||
doit:
|
doit:
|
||||||
if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
|
if (! _bfd_elf_link_record_dynamic_symbol (eif->info, h))
|
||||||
{
|
{
|
||||||
eif->failed = true;
|
eif->failed = true;
|
||||||
@ -4345,7 +4345,7 @@ elf_link_assign_sym_version (h, data)
|
|||||||
(_("%s: undefined versioned symbol name %s"),
|
(_("%s: undefined versioned symbol name %s"),
|
||||||
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
|
bfd_get_filename (sinfo->output_bfd), h->root.root.string);
|
||||||
bfd_set_error (bfd_error_bad_value);
|
bfd_set_error (bfd_error_bad_value);
|
||||||
error_return:
|
error_return:
|
||||||
sinfo->failed = true;
|
sinfo->failed = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -4359,13 +4359,13 @@ error_return:
|
|||||||
if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
|
if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL)
|
||||||
{
|
{
|
||||||
struct bfd_elf_version_tree *t;
|
struct bfd_elf_version_tree *t;
|
||||||
struct bfd_elf_version_tree *deflt;
|
struct bfd_elf_version_tree *local_ver;
|
||||||
struct bfd_elf_version_expr *d;
|
struct bfd_elf_version_expr *d;
|
||||||
|
|
||||||
/* See if can find what version this symbol is in. If the
|
/* See if can find what version this symbol is in. If the
|
||||||
symbol is supposed to be local, then don't actually register
|
symbol is supposed to be local, then don't actually register
|
||||||
it. */
|
it. */
|
||||||
deflt = NULL;
|
local_ver = NULL;
|
||||||
for (t = sinfo->verdefs; t != NULL; t = t->next)
|
for (t = sinfo->verdefs; t != NULL; t = t->next)
|
||||||
{
|
{
|
||||||
if (t->globals != NULL)
|
if (t->globals != NULL)
|
||||||
@ -4375,6 +4375,7 @@ error_return:
|
|||||||
if ((*d->match) (d, h->root.root.string))
|
if ((*d->match) (d, h->root.root.string))
|
||||||
{
|
{
|
||||||
h->verinfo.vertree = t;
|
h->verinfo.vertree = t;
|
||||||
|
local_ver = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4387,17 +4388,13 @@ error_return:
|
|||||||
{
|
{
|
||||||
for (d = t->locals; d != NULL; d = d->next)
|
for (d = t->locals; d != NULL; d = d->next)
|
||||||
{
|
{
|
||||||
|
/* If the match is "*", keep looking for a more
|
||||||
|
explicit, perhaps even global, match. */
|
||||||
if (d->pattern[0] == '*' && d->pattern[1] == '\0')
|
if (d->pattern[0] == '*' && d->pattern[1] == '\0')
|
||||||
deflt = t;
|
local_ver = t;
|
||||||
else if ((*d->match) (d, h->root.root.string))
|
else if ((*d->match) (d, h->root.root.string))
|
||||||
{
|
{
|
||||||
h->verinfo.vertree = t;
|
local_ver = t;
|
||||||
if (h->dynindx != -1
|
|
||||||
&& info->shared
|
|
||||||
&& ! info->export_dynamic)
|
|
||||||
{
|
|
||||||
(*bed->elf_backend_hide_symbol) (info, h, true);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4407,9 +4404,9 @@ error_return:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deflt != NULL && h->verinfo.vertree == NULL)
|
if (local_ver != NULL)
|
||||||
{
|
{
|
||||||
h->verinfo.vertree = deflt;
|
h->verinfo.vertree = local_ver;
|
||||||
if (h->dynindx != -1
|
if (h->dynindx != -1
|
||||||
&& info->shared
|
&& info->shared
|
||||||
&& ! info->export_dynamic)
|
&& ! info->export_dynamic)
|
||||||
@ -4448,8 +4445,8 @@ error_return:
|
|||||||
if (newh
|
if (newh
|
||||||
&& (newh->root.type == bfd_link_hash_defined
|
&& (newh->root.type == bfd_link_hash_defined
|
||||||
|| newh->root.type == bfd_link_hash_defweak))
|
|| newh->root.type == bfd_link_hash_defweak))
|
||||||
/* We find a hidden versioned definition. Hide the default
|
/* We found a hidden versioned definition. Hide the
|
||||||
one. */
|
default one. */
|
||||||
(*bed->elf_backend_hide_symbol) (info, h, true);
|
(*bed->elf_backend_hide_symbol) (info, h, true);
|
||||||
|
|
||||||
free (newname);
|
free (newname);
|
||||||
@ -4676,10 +4673,12 @@ elf_link_adjust_relocs (abfd, rel_hdr, count, rel_hash)
|
|||||||
free (irela);
|
free (irela);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct elf_link_sort_rela {
|
struct elf_link_sort_rela
|
||||||
|
{
|
||||||
bfd_vma offset;
|
bfd_vma offset;
|
||||||
enum elf_reloc_type_class type;
|
enum elf_reloc_type_class type;
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
Elf_Internal_Rel rel;
|
Elf_Internal_Rel rel;
|
||||||
Elf_Internal_Rela rela;
|
Elf_Internal_Rela rela;
|
||||||
} u;
|
} u;
|
||||||
@ -6482,8 +6481,8 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler) (
|
(*_bfd_error_handler)
|
||||||
_("%s: relocation size mismatch in %s section %s"),
|
(_("%s: relocation size mismatch in %s section %s"),
|
||||||
bfd_get_filename (output_bfd),
|
bfd_get_filename (output_bfd),
|
||||||
bfd_archive_filename (input_section->owner),
|
bfd_archive_filename (input_section->owner),
|
||||||
input_section->name);
|
input_section->name);
|
||||||
@ -6493,8 +6492,8 @@ elf_link_output_relocs (output_bfd, input_section, input_rel_hdr,
|
|||||||
|
|
||||||
bed = get_elf_backend_data (output_bfd);
|
bed = get_elf_backend_data (output_bfd);
|
||||||
irela = internal_relocs;
|
irela = internal_relocs;
|
||||||
irelaend = irela + NUM_SHDR_ENTRIES (input_rel_hdr)
|
irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr)
|
||||||
* bed->s->int_rels_per_ext_rel;
|
* bed->s->int_rels_per_ext_rel);
|
||||||
|
|
||||||
if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
|
if (input_rel_hdr->sh_entsize == sizeof (Elf_External_Rel))
|
||||||
{
|
{
|
||||||
@ -7129,7 +7128,6 @@ elf_link_input_bfd (finfo, input_bfd)
|
|||||||
internal_relocs))
|
internal_relocs))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7646,28 +7644,27 @@ elf_finish_pointer_linker_section (output_bfd, input_bfd, info, lsect, h,
|
|||||||
/* Garbage collect unused sections. */
|
/* Garbage collect unused sections. */
|
||||||
|
|
||||||
static boolean elf_gc_mark
|
static boolean elf_gc_mark
|
||||||
PARAMS ((struct bfd_link_info *info, asection *sec,
|
PARAMS ((struct bfd_link_info *, asection *,
|
||||||
asection * (*gc_mark_hook)
|
asection * (*) (asection *, struct bfd_link_info *,
|
||||||
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
|
Elf_Internal_Rela *, struct elf_link_hash_entry *,
|
||||||
struct elf_link_hash_entry *, Elf_Internal_Sym *))));
|
Elf_Internal_Sym *)));
|
||||||
|
|
||||||
static boolean elf_gc_sweep
|
static boolean elf_gc_sweep
|
||||||
PARAMS ((struct bfd_link_info *info,
|
PARAMS ((struct bfd_link_info *,
|
||||||
boolean (*gc_sweep_hook)
|
boolean (*) (bfd *, struct bfd_link_info *, asection *,
|
||||||
PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
|
const Elf_Internal_Rela *)));
|
||||||
const Elf_Internal_Rela *relocs))));
|
|
||||||
|
|
||||||
static boolean elf_gc_sweep_symbol
|
static boolean elf_gc_sweep_symbol
|
||||||
PARAMS ((struct elf_link_hash_entry *h, PTR idxptr));
|
PARAMS ((struct elf_link_hash_entry *, PTR));
|
||||||
|
|
||||||
static boolean elf_gc_allocate_got_offsets
|
static boolean elf_gc_allocate_got_offsets
|
||||||
PARAMS ((struct elf_link_hash_entry *h, PTR offarg));
|
PARAMS ((struct elf_link_hash_entry *, PTR));
|
||||||
|
|
||||||
static boolean elf_gc_propagate_vtable_entries_used
|
static boolean elf_gc_propagate_vtable_entries_used
|
||||||
PARAMS ((struct elf_link_hash_entry *h, PTR dummy));
|
PARAMS ((struct elf_link_hash_entry *, PTR));
|
||||||
|
|
||||||
static boolean elf_gc_smash_unused_vtentry_relocs
|
static boolean elf_gc_smash_unused_vtentry_relocs
|
||||||
PARAMS ((struct elf_link_hash_entry *h, PTR dummy));
|
PARAMS ((struct elf_link_hash_entry *, PTR));
|
||||||
|
|
||||||
/* The mark phase of garbage collection. For a given section, mark
|
/* The mark phase of garbage collection. For a given section, mark
|
||||||
it and any sections in this section's group, and all the sections
|
it and any sections in this section's group, and all the sections
|
||||||
@ -7677,9 +7674,10 @@ static boolean
|
|||||||
elf_gc_mark (info, sec, gc_mark_hook)
|
elf_gc_mark (info, sec, gc_mark_hook)
|
||||||
struct bfd_link_info *info;
|
struct bfd_link_info *info;
|
||||||
asection *sec;
|
asection *sec;
|
||||||
asection * (*gc_mark_hook)
|
asection * (*gc_mark_hook) PARAMS ((asection *, struct bfd_link_info *,
|
||||||
PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
|
Elf_Internal_Rela *,
|
||||||
struct elf_link_hash_entry *, Elf_Internal_Sym *));
|
struct elf_link_hash_entry *,
|
||||||
|
Elf_Internal_Sym *));
|
||||||
{
|
{
|
||||||
boolean ret;
|
boolean ret;
|
||||||
asection *group_sec;
|
asection *group_sec;
|
||||||
@ -7791,9 +7789,8 @@ elf_gc_mark (info, sec, gc_mark_hook)
|
|||||||
static boolean
|
static boolean
|
||||||
elf_gc_sweep (info, gc_sweep_hook)
|
elf_gc_sweep (info, gc_sweep_hook)
|
||||||
struct bfd_link_info *info;
|
struct bfd_link_info *info;
|
||||||
boolean (*gc_sweep_hook)
|
boolean (*gc_sweep_hook) PARAMS ((bfd *, struct bfd_link_info *,
|
||||||
PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o,
|
asection *, const Elf_Internal_Rela *));
|
||||||
const Elf_Internal_Rela *relocs));
|
|
||||||
{
|
{
|
||||||
bfd *sub;
|
bfd *sub;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user