Formatting fixes.

* ldbuildid.c: Formatting.
	* ldcref.c: Formatting.
	* ldctor.c: Formatting.
	* ldemul.c: Formatting.
	* ldexp.c: Formatting.
	* ldfile.c: Formatting.
	* ldlang.c: Formatting.
	* ldmain.c: Formatting.
	* ldwrite.c: Formatting.
This commit is contained in:
Alan Modra 2016-06-14 13:25:21 +09:30
parent 3860d2b4b7
commit 0aa7f5862e
10 changed files with 206 additions and 184 deletions

View file

@ -1,3 +1,15 @@
2016-06-14 Alan Modra <amodra@gmail.com>
* ldbuildid.c: Formatting.
* ldcref.c: Formatting.
* ldctor.c: Formatting.
* ldemul.c: Formatting.
* ldexp.c: Formatting.
* ldfile.c: Formatting.
* ldlang.c: Formatting.
* ldmain.c: Formatting.
* ldwrite.c: Formatting.
2016-06-14 Alan Modra <amodra@gmail.com> 2016-06-14 Alan Modra <amodra@gmail.com>
* ldlang.c: Expand uses of bfd_my_archive. * ldlang.c: Expand uses of bfd_my_archive.

View file

@ -346,10 +346,10 @@ cref_fill_array (struct cref_hash_entry *h, void *data)
static int static int
cref_sort_array (const void *a1, const void *a2) cref_sort_array (const void *a1, const void *a2)
{ {
const struct cref_hash_entry * const *p1 = const struct cref_hash_entry *const *p1
(const struct cref_hash_entry * const *) a1; = (const struct cref_hash_entry *const *) a1;
const struct cref_hash_entry * const *p2 = const struct cref_hash_entry *const *p2
(const struct cref_hash_entry * const *) a2; = (const struct cref_hash_entry *const *) a2;
if (demangling) if (demangling)
return strcmp ((*p1)->demangled, (*p2)->demangled); return strcmp ((*p1)->demangled, (*p2)->demangled);
@ -595,7 +595,8 @@ check_nocrossref (struct cref_hash_entry *h, void *ignore ATTRIBUTE_UNUSED)
/* The struct is used to pass information from check_refs to /* The struct is used to pass information from check_refs to
check_reloc_refs through bfd_map_over_sections. */ check_reloc_refs through bfd_map_over_sections. */
struct check_refs_info { struct check_refs_info
{
const char *sym_name; const char *sym_name;
asection *defsec; asection *defsec;
struct lang_nocrossrefs *ncrs; struct lang_nocrossrefs *ncrs;

View file

@ -151,10 +151,10 @@ ctor_prio (const char *name)
static int static int
ctor_cmp (const void *p1, const void *p2) ctor_cmp (const void *p1, const void *p2)
{ {
const struct set_element * const *pe1 = const struct set_element *const *pe1
(const struct set_element * const *) p1; = (const struct set_element *const *) p1;
const struct set_element * const *pe2 = const struct set_element *const *pe2
(const struct set_element * const *) p2; = (const struct set_element *const *) p2;
const char *n1; const char *n1;
const char *n2; const char *n2;
int prio1; int prio1;

View file

@ -441,7 +441,8 @@ fold_binary (etree_type *tree)
if (!seg->used if (!seg->used
&& config.magic_demand_paged && config.magic_demand_paged
&& (seg->value % config.maxpagesize) != 0) && (seg->value % config.maxpagesize) != 0)
einfo (_("%P: warning: address of `%s' isn't multiple of maximum page size\n"), einfo (_("%P: warning: address of `%s' "
"isn't multiple of maximum page size\n"),
segment_name); segment_name);
seg->used = TRUE; seg->used = TRUE;
new_rel_from_abs (seg->value); new_rel_from_abs (seg->value);

View file

@ -285,7 +285,8 @@ ldfile_try_open_bfd (const char *attempt,
command_line.accept_unknown_input_arch) command_line.accept_unknown_input_arch)
/* XCOFF archives can have 32 and 64 bit objects. */ /* XCOFF archives can have 32 and 64 bit objects. */
&& !(bfd_get_flavour (check) == bfd_target_xcoff_flavour && !(bfd_get_flavour (check) == bfd_target_xcoff_flavour
&& bfd_get_flavour (link_info.output_bfd) == bfd_target_xcoff_flavour && (bfd_get_flavour (link_info.output_bfd)
== bfd_target_xcoff_flavour)
&& bfd_check_format (entry->the_bfd, bfd_archive))) && bfd_check_format (entry->the_bfd, bfd_archive)))
{ {
if (command_line.warn_search_mismatch) if (command_line.warn_search_mismatch)
@ -627,8 +628,8 @@ void
ldfile_add_arch (const char *in_name) ldfile_add_arch (const char *in_name)
{ {
char *name = xstrdup (in_name); char *name = xstrdup (in_name);
search_arch_type *new_arch = (search_arch_type *) search_arch_type *new_arch
xmalloc (sizeof (search_arch_type)); = (search_arch_type *) xmalloc (sizeof (search_arch_type));
ldfile_output_machine_name = in_name; ldfile_output_machine_name = in_name;

View file

@ -2153,7 +2153,8 @@ lang_map (void)
lang_statement_iteration++; lang_statement_iteration++;
print_statements (); print_statements ();
ldemul_extra_map_file_text (link_info.output_bfd, &link_info, config.map_file); ldemul_extra_map_file_text (link_info.output_bfd, &link_info,
config.map_file);
} }
static bfd_boolean static bfd_boolean
@ -2204,7 +2205,8 @@ init_os (lang_output_section_statement_type *s, flagword flags)
s->name, flags); s->name, flags);
if (s->bfd_section == NULL) if (s->bfd_section == NULL)
{ {
einfo (_("%P%F: output format %s cannot represent section called %s: %E\n"), einfo (_("%P%F: output format %s cannot represent section"
" called %s: %E\n"),
link_info.output_bfd->xvec->name, s->name); link_info.output_bfd->xvec->name, s->name);
} }
s->bfd_section->output_section = s->bfd_section; s->bfd_section->output_section = s->bfd_section;
@ -4171,7 +4173,8 @@ print_all_symbols (asection *sec)
/* Sort the symbols by address. */ /* Sort the symbols by address. */
entries = (struct bfd_link_hash_entry **) entries = (struct bfd_link_hash_entry **)
obstack_alloc (&map_obstack, ud->map_symbol_def_count * sizeof (*entries)); obstack_alloc (&map_obstack,
ud->map_symbol_def_count * sizeof (*entries));
for (i = 0, def = ud->map_symbol_def_head; def; def = def->next, i++) for (i = 0, def = ud->map_symbol_def_head; def; def = def->next, i++)
entries[i] = def->entry; entries[i] = def->entry;
@ -5143,8 +5146,8 @@ lang_size_sections_1
so people can fix their linker scripts. */ so people can fix their linker scripts. */
if (last->vma != last->lma) if (last->vma != last->lma)
einfo (_("%P: warning: dot moved backwards before `%s'\n"), einfo (_("%P: warning: dot moved backwards "
os->name); "before `%s'\n"), os->name);
} }
else else
{ {
@ -5631,7 +5634,8 @@ lang_do_assignments_1 (lang_statement_union_type *s,
dot += TO_ADDR (os->bfd_section->size); dot += TO_ADDR (os->bfd_section->size);
if (os->update_dot_tree != NULL) if (os->update_dot_tree != NULL)
exp_fold_tree (os->update_dot_tree, bfd_abs_section_ptr, &dot); exp_fold_tree (os->update_dot_tree, bfd_abs_section_ptr,
&dot);
} }
} }
break; break;
@ -6315,7 +6319,8 @@ lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert)
break; break;
default: default:
einfo (_("%P%F: invalid character %c (%d) in flags\n"), * flags, * flags); einfo (_("%P%F: invalid character %c (%d) in flags\n"),
*flags, *flags);
break; break;
} }
flags++; flags++;
@ -6441,7 +6446,8 @@ lang_enter_output_section_statement (const char *output_section_statement_name,
os->align_lma_with_input = align_with_input == ALIGN_WITH_INPUT; os->align_lma_with_input = align_with_input == ALIGN_WITH_INPUT;
if (os->align_lma_with_input && align != NULL) if (os->align_lma_with_input && align != NULL)
einfo (_("%F%P:%S: error: align with input and explicit align specified\n"), NULL); einfo (_("%F%P:%S: error: align with input and explicit align specified\n"),
NULL);
os->subsection_alignment = os->subsection_alignment =
topower (exp_get_value_int (subalign, -1, "subsection alignment")); topower (exp_get_value_int (subalign, -1, "subsection alignment"));
@ -6719,7 +6725,7 @@ find_replacements_insert_point (void)
if (claim1->flags.claimed) if (claim1->flags.claimed)
return claim1->flags.claim_archive ? lastobject : claim1; return claim1->flags.claim_archive ? lastobject : claim1;
/* Update lastobject if this is a real object file. */ /* Update lastobject if this is a real object file. */
if (claim1->the_bfd && (claim1->the_bfd->my_archive == NULL)) if (claim1->the_bfd != NULL && claim1->the_bfd->my_archive == NULL)
lastobject = claim1; lastobject = claim1;
} }
/* No files were claimed by the plugin. Choose the last object /* No files were claimed by the plugin. Choose the last object
@ -6882,7 +6888,8 @@ lang_process (void)
} }
#endif /* ENABLE_PLUGINS */ #endif /* ENABLE_PLUGINS */
/* Make sure that nobody has tried to add a symbol to this list before now. */ /* Make sure that nobody has tried to add a symbol to this list
before now. */
ASSERT (link_info.gc_sym_list == NULL); ASSERT (link_info.gc_sym_list == NULL);
link_info.gc_sym_list = &entry_symbol; link_info.gc_sym_list = &entry_symbol;
@ -8231,7 +8238,8 @@ lang_do_memory_regions (void)
r->current = r->origin; r->current = r->origin;
} }
else else
einfo (_("%F%P: invalid origin for memory region %s\n"), r->name_list.name); einfo (_("%F%P: invalid origin for memory region %s\n"),
r->name_list.name);
} }
if (r->length_exp) if (r->length_exp)
{ {
@ -8239,7 +8247,8 @@ lang_do_memory_regions (void)
if (expld.result.valid_p) if (expld.result.valid_p)
r->length = expld.result.value; r->length = expld.result.value;
else else
einfo (_("%F%P: invalid length for memory region %s\n"), r->name_list.name); einfo (_("%F%P: invalid length for memory region %s\n"),
r->name_list.name);
} }
} }
} }

View file

@ -654,8 +654,8 @@ add_ysym (const char *name)
{ {
if (link_info.notice_hash == NULL) if (link_info.notice_hash == NULL)
{ {
link_info.notice_hash = link_info.notice_hash
(struct bfd_hash_table *) xmalloc (sizeof (struct bfd_hash_table)); = (struct bfd_hash_table *) xmalloc (sizeof (struct bfd_hash_table));
if (!bfd_hash_table_init_n (link_info.notice_hash, if (!bfd_hash_table_init_n (link_info.notice_hash,
bfd_hash_newfunc, bfd_hash_newfunc,
sizeof (struct bfd_hash_entry), sizeof (struct bfd_hash_entry),
@ -691,8 +691,8 @@ add_wrap (const char *name)
{ {
if (link_info.wrap_hash == NULL) if (link_info.wrap_hash == NULL)
{ {
link_info.wrap_hash = link_info.wrap_hash
(struct bfd_hash_table *) xmalloc (sizeof (struct bfd_hash_table)); = (struct bfd_hash_table *) xmalloc (sizeof (struct bfd_hash_table));
if (!bfd_hash_table_init_n (link_info.wrap_hash, if (!bfd_hash_table_init_n (link_info.wrap_hash,
bfd_hash_newfunc, bfd_hash_newfunc,
sizeof (struct bfd_hash_entry), sizeof (struct bfd_hash_entry),
@ -1391,12 +1391,14 @@ reloc_overflow (struct bfd_link_info *info,
{ {
case bfd_link_hash_undefined: case bfd_link_hash_undefined:
case bfd_link_hash_undefweak: case bfd_link_hash_undefweak:
einfo (_(" relocation truncated to fit: %s against undefined symbol `%T'"), einfo (_(" relocation truncated to fit: "
"%s against undefined symbol `%T'"),
reloc_name, entry->root.string); reloc_name, entry->root.string);
break; break;
case bfd_link_hash_defined: case bfd_link_hash_defined:
case bfd_link_hash_defweak: case bfd_link_hash_defweak:
einfo (_(" relocation truncated to fit: %s against symbol `%T' defined in %A section in %B"), einfo (_(" relocation truncated to fit: "
"%s against symbol `%T' defined in %A section in %B"),
reloc_name, entry->root.string, reloc_name, entry->root.string,
entry->u.def.section, entry->u.def.section,
entry->u.def.section == bfd_abs_section_ptr entry->u.def.section == bfd_abs_section_ptr

View file

@ -409,13 +409,9 @@ ds (asection *s)
while (l) while (l)
{ {
if (l->type == bfd_indirect_link_order) if (l->type == bfd_indirect_link_order)
{
printf ("%8x %s\n", l->offset, l->u.indirect.section->owner->filename); printf ("%8x %s\n", l->offset, l->u.indirect.section->owner->filename);
}
else else
{
printf (_("%8x something else\n"), l->offset); printf (_("%8x something else\n"), l->offset);
}
l = l->next; l = l->next;
} }
printf ("\n"); printf ("\n");