elflink.c whitespace, formatting and a plugin symbol tweak
* elflink.c: Whitespace, formatting fixes. (elf_link_input_bfd): Clarify comment. (elf_link_output_extsym): Exclude symbols in linker created sections when testing for plugin symbols.
This commit is contained in:
parent
dddcc5b9a8
commit
ca4be51cd8
|
@ -1,3 +1,10 @@
|
|||
2015-02-09 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* elflink.c: Whitespace, formatting fixes.
|
||||
(elf_link_input_bfd): Clarify comment.
|
||||
(elf_link_output_extsym): Exclude symbols in linker created
|
||||
sections when testing for plugin symbols.
|
||||
|
||||
2015-02-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR ld/17935
|
||||
|
|
|
@ -2281,8 +2281,8 @@ _bfd_elf_link_size_reloc_section (bfd *abfd,
|
|||
{
|
||||
struct elf_link_hash_entry **p;
|
||||
|
||||
p = (struct elf_link_hash_entry **)
|
||||
bfd_zmalloc (reldata->count * sizeof (struct elf_link_hash_entry *));
|
||||
p = ((struct elf_link_hash_entry **)
|
||||
bfd_zmalloc (reldata->count * sizeof (*p)));
|
||||
if (p == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
@ -4384,8 +4384,8 @@ error_free_dyn:
|
|||
{
|
||||
amt = ((isymend - isym + 1)
|
||||
* sizeof (struct elf_link_hash_entry *));
|
||||
nondeflt_vers =
|
||||
(struct elf_link_hash_entry **) bfd_malloc (amt);
|
||||
nondeflt_vers
|
||||
= (struct elf_link_hash_entry **) bfd_malloc (amt);
|
||||
if (!nondeflt_vers)
|
||||
goto error_free_vers;
|
||||
}
|
||||
|
@ -4860,8 +4860,7 @@ error_free_dyn:
|
|||
/* Add this bfd to the loaded list. */
|
||||
struct elf_link_loaded_list *n;
|
||||
|
||||
n = (struct elf_link_loaded_list *)
|
||||
bfd_alloc (abfd, sizeof (struct elf_link_loaded_list));
|
||||
n = (struct elf_link_loaded_list *) bfd_alloc (abfd, sizeof (*n));
|
||||
if (n == NULL)
|
||||
goto error_return;
|
||||
n->abfd = abfd;
|
||||
|
@ -7267,10 +7266,10 @@ bfd_elf_match_symbols_in_sections (asection *sec1, asection *sec2,
|
|||
if (count1 == 0 || count2 == 0 || count1 != count2)
|
||||
goto done;
|
||||
|
||||
symtable1 = (struct elf_symbol *)
|
||||
bfd_malloc (count1 * sizeof (struct elf_symbol));
|
||||
symtable2 = (struct elf_symbol *)
|
||||
bfd_malloc (count2 * sizeof (struct elf_symbol));
|
||||
symtable1
|
||||
= (struct elf_symbol *) bfd_malloc (count1 * sizeof (*symtable1));
|
||||
symtable2
|
||||
= (struct elf_symbol *) bfd_malloc (count2 * sizeof (*symtable2));
|
||||
if (symtable1 == NULL || symtable2 == NULL)
|
||||
goto done;
|
||||
|
||||
|
@ -8945,7 +8944,8 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
|
|||
|| h->root.type == bfd_link_hash_defweak)
|
||||
&& ((flinfo->info->strip_discarded
|
||||
&& discarded_section (h->root.u.def.section))
|
||||
|| (h->root.u.def.section->owner != NULL
|
||||
|| ((h->root.u.def.section->flags & SEC_LINKER_CREATED) == 0
|
||||
&& h->root.u.def.section->owner != NULL
|
||||
&& (h->root.u.def.section->owner->flags & BFD_PLUGIN) != 0)))
|
||||
strip = TRUE;
|
||||
else if ((h->root.type == bfd_link_hash_undefined
|
||||
|
@ -9794,8 +9794,10 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
|
|||
s_type = h->type;
|
||||
|
||||
/* If a plugin symbol is referenced from a non-IR file,
|
||||
mark the symbol as undefined, except for symbol for
|
||||
linker created section. */
|
||||
mark the symbol as undefined. Note that the
|
||||
linker may attach linker created dynamic sections
|
||||
to the plugin bfd. Symbols defined in linker
|
||||
created sections are not plugin symbols. */
|
||||
if (h->root.non_ir_ref
|
||||
&& (h->root.type == bfd_link_hash_defined
|
||||
|| h->root.type == bfd_link_hash_defweak)
|
||||
|
@ -12519,8 +12521,8 @@ bfd_elf_gc_record_vtinherit (bfd *abfd,
|
|||
win:
|
||||
if (!child->vtable)
|
||||
{
|
||||
child->vtable = (struct elf_link_virtual_table_entry *)
|
||||
bfd_zalloc (abfd, sizeof (*child->vtable));
|
||||
child->vtable = ((struct elf_link_virtual_table_entry *)
|
||||
bfd_zalloc (abfd, sizeof (*child->vtable)));
|
||||
if (!child->vtable)
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -12552,8 +12554,8 @@ bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED,
|
|||
|
||||
if (!h->vtable)
|
||||
{
|
||||
h->vtable = (struct elf_link_virtual_table_entry *)
|
||||
bfd_zalloc (abfd, sizeof (*h->vtable));
|
||||
h->vtable = ((struct elf_link_virtual_table_entry *)
|
||||
bfd_zalloc (abfd, sizeof (*h->vtable)));
|
||||
if (!h->vtable)
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -13211,10 +13213,10 @@ _bfd_elf_get_dynamic_reloc_section (bfd * abfd,
|
|||
string table associated with ABFD. */
|
||||
|
||||
asection *
|
||||
_bfd_elf_make_dynamic_reloc_section (asection * sec,
|
||||
bfd * dynobj,
|
||||
_bfd_elf_make_dynamic_reloc_section (asection *sec,
|
||||
bfd *dynobj,
|
||||
unsigned int alignment,
|
||||
bfd * abfd,
|
||||
bfd *abfd,
|
||||
bfd_boolean is_rela)
|
||||
{
|
||||
asection * reloc_sec = elf_section_data (sec)->sreloc;
|
||||
|
|
Loading…
Reference in New Issue