Fix formatting in elf32-arm.c

This commit is contained in:
Nick Clifton
2021-05-25 11:13:35 +01:00
parent bc30a119f3
commit cc850f7472
2 changed files with 203 additions and 183 deletions

View File

@ -1,3 +1,7 @@
2021-05-25 Nick Clifton <nickc@redhat.com>
* elf32-arm.c: Fix formatting.
2021-05-25 Alan Modra <amodra@gmail.com>
* elf-attrs.c (elf_attr_strdup): New function.

View File

@ -3135,7 +3135,8 @@ struct arm_local_iplt_info
};
/* Structure to handle FDPIC support for local functions. */
struct fdpic_local {
struct fdpic_local
{
unsigned int funcdesc_cnt;
unsigned int gotofffuncdesc_cnt;
int funcdesc_offset;
@ -3145,6 +3146,12 @@ struct elf_arm_obj_tdata
{
struct elf_obj_tdata root;
/* Zero to warn when linking objects with incompatible enum sizes. */
int no_enum_size_warning;
/* Zero to warn when linking objects with incompatible wchar_t sizes. */
int no_wchar_size_warning;
/* tls_type for each local got entry. */
char *local_got_tls_type;
@ -3154,12 +3161,6 @@ struct elf_arm_obj_tdata
/* Information for local symbols that need entries in .iplt. */
struct arm_local_iplt_info **local_iplt;
/* Zero to warn when linking objects with incompatible enum sizes. */
int no_enum_size_warning;
/* Zero to warn when linking objects with incompatible wchar_t sizes. */
int no_wchar_size_warning;
/* Maintains FDPIC counters and funcdesc info. */
struct fdpic_local *local_fdpic_cnts;
};
@ -3724,7 +3725,7 @@ elf32_arm_get_local_dynreloc_list (bfd *abfd, unsigned long r_symndx,
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
if (s == NULL)
abort ();
return NULL;
vpp = &elf_section_data (s)->local_dynrel;
return (struct elf_dyn_relocs **) vpp;
@ -11647,6 +11648,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
else
{
BFD_ASSERT (local_got_offsets != NULL);
off = local_got_offsets[r_symndx];
offplt = local_tlsdesc_gotents[r_symndx];
tls_type = elf32_arm_local_got_tls_type (input_bfd)[r_symndx];
@ -12572,7 +12574,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
bfd_vma seg = -1;
if (bfd_link_pic (info) && dynindx == 0)
abort();
{
* error_message = _("no dynamic index information available");
return bfd_reloc_dangerous;
}
/* Resolve relocation. */
bfd_put_32 (output_bfd, (offset + sgot->output_offset)
@ -12603,12 +12608,18 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
}
if (bfd_link_pic (info) && dynindx == 0)
abort();
{
* error_message = _("no dynamic index information available");
return bfd_reloc_dangerous;
}
/* This case cannot occur since funcdesc is allocated by
the dynamic loader so we cannot resolve the relocation. */
if (h->dynindx != -1)
abort();
{
* error_message = _("invalid dynamic index");
return bfd_reloc_dangerous;
}
/* Resolve relocation. */
bfd_put_32 (output_bfd, (offset + sgot->output_offset),
@ -12697,7 +12708,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
{
/* Such relocation on static function should not have been
emitted by the compiler. */
abort();
return bfd_reloc_notsupported;
}
}
*unresolved_reloc_p = false;
@ -12715,7 +12726,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
bfd_vma seg = -1;
if (bfd_link_pic (info) && dynindx == 0)
abort();
{
* error_message = _("dynamic index information not available");
return bfd_reloc_dangerous;
}
/* Replace static FUNCDESC relocation with a
R_ARM_RELATIVE dynamic relocation or with a rofixup for
@ -13414,6 +13428,7 @@ add_unwind_table_edit (arm_unwind_table_edit **head,
static _arm_elf_section_data *get_arm_elf_section_data (asection *);
/* Increase the size of EXIDX_SEC by ADJUST bytes. ADJUST mau be negative. */
static void
adjust_exidx_size (asection *exidx_sec, int adjust)
{
@ -13429,14 +13444,15 @@ adjust_exidx_size(asection *exidx_sec, int adjust)
}
/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
static void
insert_cantunwind_after (asection *text_sec, asection *exidx_sec)
{
struct _arm_elf_section_data *exidx_arm_data;
exidx_arm_data = get_arm_elf_section_data (exidx_sec);
add_unwind_table_edit (
&exidx_arm_data->u.exidx.unwind_edit_list,
add_unwind_table_edit
(&exidx_arm_data->u.exidx.unwind_edit_list,
&exidx_arm_data->u.exidx.unwind_edit_tail,
INSERT_EXIDX_CANTUNWIND_AT_END, text_sec, UINT_MAX);
@ -15278,7 +15294,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
/* Such a relocation is not supposed to be generated
by gcc on a static function. */
/* Anyway if needed it could be handled. */
abort();
return false;
}
else
{
@ -15592,11 +15608,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
p->pc_count += 1;
p->count += 1;
if (h == NULL && htab->fdpic_p && !bfd_link_pic (info)
&& r_type != R_ARM_ABS32 && r_type != R_ARM_ABS32_NOI) {
&& r_type != R_ARM_ABS32 && r_type != R_ARM_ABS32_NOI)
{
/* Here we only support R_ARM_ABS32 and R_ARM_ABS32_NOI
that will become rofixup. */
/* This is due to the fact that we suppose all will become rofixup. */
fprintf(stderr, "FDPIC does not yet support %d relocation to become dynamic for executable\n", r_type);
_bfd_error_handler
(_("FDPIC does not yet support %s relocation"
" to become dynamic for executable"),
@ -16670,7 +16686,7 @@ elf32_arm_size_dynamic_sections (bfd * output_bfd ATTRIBUTE_UNUSED,
}
local_got = elf_local_got_refcounts (ibfd);
if (!local_got)
if (local_got == NULL)
continue;
symtab_hdr = & elf_symtab_hdr (ibfd);