mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-15 01:00:26 +08:00
Fix formatting in elf32-arm.c
This commit is contained in:
@ -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>
|
2021-05-25 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf-attrs.c (elf_attr_strdup): New function.
|
* elf-attrs.c (elf_attr_strdup): New function.
|
||||||
|
@ -3135,7 +3135,8 @@ struct arm_local_iplt_info
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Structure to handle FDPIC support for local functions. */
|
/* Structure to handle FDPIC support for local functions. */
|
||||||
struct fdpic_local {
|
struct fdpic_local
|
||||||
|
{
|
||||||
unsigned int funcdesc_cnt;
|
unsigned int funcdesc_cnt;
|
||||||
unsigned int gotofffuncdesc_cnt;
|
unsigned int gotofffuncdesc_cnt;
|
||||||
int funcdesc_offset;
|
int funcdesc_offset;
|
||||||
@ -3145,6 +3146,12 @@ struct elf_arm_obj_tdata
|
|||||||
{
|
{
|
||||||
struct elf_obj_tdata root;
|
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. */
|
/* tls_type for each local got entry. */
|
||||||
char *local_got_tls_type;
|
char *local_got_tls_type;
|
||||||
|
|
||||||
@ -3154,12 +3161,6 @@ struct elf_arm_obj_tdata
|
|||||||
/* Information for local symbols that need entries in .iplt. */
|
/* Information for local symbols that need entries in .iplt. */
|
||||||
struct arm_local_iplt_info **local_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. */
|
/* Maintains FDPIC counters and funcdesc info. */
|
||||||
struct fdpic_local *local_fdpic_cnts;
|
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);
|
s = bfd_section_from_elf_index (abfd, isym->st_shndx);
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
abort ();
|
return NULL;
|
||||||
|
|
||||||
vpp = &elf_section_data (s)->local_dynrel;
|
vpp = &elf_section_data (s)->local_dynrel;
|
||||||
return (struct elf_dyn_relocs **) vpp;
|
return (struct elf_dyn_relocs **) vpp;
|
||||||
@ -11647,6 +11648,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BFD_ASSERT (local_got_offsets != NULL);
|
BFD_ASSERT (local_got_offsets != NULL);
|
||||||
|
|
||||||
off = local_got_offsets[r_symndx];
|
off = local_got_offsets[r_symndx];
|
||||||
offplt = local_tlsdesc_gotents[r_symndx];
|
offplt = local_tlsdesc_gotents[r_symndx];
|
||||||
tls_type = elf32_arm_local_got_tls_type (input_bfd)[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;
|
bfd_vma seg = -1;
|
||||||
|
|
||||||
if (bfd_link_pic (info) && dynindx == 0)
|
if (bfd_link_pic (info) && dynindx == 0)
|
||||||
abort();
|
{
|
||||||
|
* error_message = _("no dynamic index information available");
|
||||||
|
return bfd_reloc_dangerous;
|
||||||
|
}
|
||||||
|
|
||||||
/* Resolve relocation. */
|
/* Resolve relocation. */
|
||||||
bfd_put_32 (output_bfd, (offset + sgot->output_offset)
|
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)
|
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
|
/* This case cannot occur since funcdesc is allocated by
|
||||||
the dynamic loader so we cannot resolve the relocation. */
|
the dynamic loader so we cannot resolve the relocation. */
|
||||||
if (h->dynindx != -1)
|
if (h->dynindx != -1)
|
||||||
abort();
|
{
|
||||||
|
* error_message = _("invalid dynamic index");
|
||||||
|
return bfd_reloc_dangerous;
|
||||||
|
}
|
||||||
|
|
||||||
/* Resolve relocation. */
|
/* Resolve relocation. */
|
||||||
bfd_put_32 (output_bfd, (offset + sgot->output_offset),
|
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
|
/* Such relocation on static function should not have been
|
||||||
emitted by the compiler. */
|
emitted by the compiler. */
|
||||||
abort();
|
return bfd_reloc_notsupported;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*unresolved_reloc_p = false;
|
*unresolved_reloc_p = false;
|
||||||
@ -12715,7 +12726,10 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
bfd_vma seg = -1;
|
bfd_vma seg = -1;
|
||||||
|
|
||||||
if (bfd_link_pic (info) && dynindx == 0)
|
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
|
/* Replace static FUNCDESC relocation with a
|
||||||
R_ARM_RELATIVE dynamic relocation or with a rofixup for
|
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 *);
|
static _arm_elf_section_data *get_arm_elf_section_data (asection *);
|
||||||
|
|
||||||
/* Increase the size of EXIDX_SEC by ADJUST bytes. ADJUST mau be negative. */
|
/* Increase the size of EXIDX_SEC by ADJUST bytes. ADJUST mau be negative. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
adjust_exidx_size (asection *exidx_sec, int adjust)
|
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. */
|
/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
insert_cantunwind_after (asection *text_sec, asection *exidx_sec)
|
insert_cantunwind_after (asection *text_sec, asection *exidx_sec)
|
||||||
{
|
{
|
||||||
struct _arm_elf_section_data *exidx_arm_data;
|
struct _arm_elf_section_data *exidx_arm_data;
|
||||||
|
|
||||||
exidx_arm_data = get_arm_elf_section_data (exidx_sec);
|
exidx_arm_data = get_arm_elf_section_data (exidx_sec);
|
||||||
add_unwind_table_edit (
|
add_unwind_table_edit
|
||||||
&exidx_arm_data->u.exidx.unwind_edit_list,
|
(&exidx_arm_data->u.exidx.unwind_edit_list,
|
||||||
&exidx_arm_data->u.exidx.unwind_edit_tail,
|
&exidx_arm_data->u.exidx.unwind_edit_tail,
|
||||||
INSERT_EXIDX_CANTUNWIND_AT_END, text_sec, UINT_MAX);
|
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
|
/* Such a relocation is not supposed to be generated
|
||||||
by gcc on a static function. */
|
by gcc on a static function. */
|
||||||
/* Anyway if needed it could be handled. */
|
/* Anyway if needed it could be handled. */
|
||||||
abort();
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -15592,11 +15608,11 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
|
|||||||
p->pc_count += 1;
|
p->pc_count += 1;
|
||||||
p->count += 1;
|
p->count += 1;
|
||||||
if (h == NULL && htab->fdpic_p && !bfd_link_pic (info)
|
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
|
/* Here we only support R_ARM_ABS32 and R_ARM_ABS32_NOI
|
||||||
that will become rofixup. */
|
that will become rofixup. */
|
||||||
/* This is due to the fact that we suppose all 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
|
_bfd_error_handler
|
||||||
(_("FDPIC does not yet support %s relocation"
|
(_("FDPIC does not yet support %s relocation"
|
||||||
" to become dynamic for executable"),
|
" 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);
|
local_got = elf_local_got_refcounts (ibfd);
|
||||||
if (!local_got)
|
if (local_got == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
symtab_hdr = & elf_symtab_hdr (ibfd);
|
symtab_hdr = & elf_symtab_hdr (ibfd);
|
||||||
|
Reference in New Issue
Block a user