mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
* elf32-xtensa.c (plt_reloc_count): Fix typo in comment.
(elf_xtensa_size_dynamic_sections): Use elf_discarded_section. (elf_xtensa_combine_prop_entries): Avoid returning non-zero without first printing an error message. (elf_xtensa_finish_dynamic_sections): Likewise. (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when discarding literal table entries. (elf_xtensa_merge_private_bfd_data): Remove newline from error message. (elf_xtensa_do_asm_simplify): Likewise.
This commit is contained in:
@ -1,3 +1,15 @@
|
|||||||
|
2003-07-23 Bob Wilson <bob.wilson@acm.org>
|
||||||
|
|
||||||
|
* elf32-xtensa.c (plt_reloc_count): Fix typo in comment.
|
||||||
|
(elf_xtensa_size_dynamic_sections): Use elf_discarded_section.
|
||||||
|
(elf_xtensa_combine_prop_entries): Avoid returning non-zero without
|
||||||
|
first printing an error message.
|
||||||
|
(elf_xtensa_finish_dynamic_sections): Likewise.
|
||||||
|
(elf_xtensa_discard_info_for_section): Adjust size of .got.loc when
|
||||||
|
discarding literal table entries.
|
||||||
|
(elf_xtensa_merge_private_bfd_data): Remove newline from error message.
|
||||||
|
(elf_xtensa_do_asm_simplify): Likewise.
|
||||||
|
|
||||||
2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
|
2003-07-23 Stephane Carrez <stcarrez@nerim.fr>
|
||||||
|
|
||||||
* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
|
* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
|
||||||
|
@ -233,7 +233,7 @@ typedef struct xtensa_relax_info_struct xtensa_relax_info;
|
|||||||
The actual PLT code must be split into multiple sections and all
|
The actual PLT code must be split into multiple sections and all
|
||||||
the sections have to be created before size_dynamic_sections,
|
the sections have to be created before size_dynamic_sections,
|
||||||
where we figure out the exact number of PLT entries that will be
|
where we figure out the exact number of PLT entries that will be
|
||||||
needed. It is OK is this count is an overestimate, e.g., some
|
needed. It is OK if this count is an overestimate, e.g., some
|
||||||
relocations may be removed by GC. */
|
relocations may be removed by GC. */
|
||||||
|
|
||||||
static int plt_reloc_count = 0;
|
static int plt_reloc_count = 0;
|
||||||
@ -1264,12 +1264,9 @@ elf_xtensa_size_dynamic_sections (output_bfd, info)
|
|||||||
continue;
|
continue;
|
||||||
for (s = abfd->sections; s != NULL; s = s->next)
|
for (s = abfd->sections; s != NULL; s = s->next)
|
||||||
{
|
{
|
||||||
/* Skip input sections that are being discarded. */
|
if (! elf_discarded_section (s)
|
||||||
if (!bfd_is_abs_section (s)
|
&& xtensa_is_littable_section (s)
|
||||||
&& bfd_is_abs_section (s->output_section))
|
&& s != spltlittbl)
|
||||||
continue;
|
|
||||||
|
|
||||||
if (xtensa_is_littable_section (s) && s != spltlittbl)
|
|
||||||
sgotloc->_raw_size += s->_raw_size;
|
sgotloc->_raw_size += s->_raw_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2259,7 +2256,11 @@ elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc)
|
|||||||
sgotloc_size = (sgotloc->_cooked_size != 0
|
sgotloc_size = (sgotloc->_cooked_size != 0
|
||||||
? sgotloc->_cooked_size : sgotloc->_raw_size);
|
? sgotloc->_cooked_size : sgotloc->_raw_size);
|
||||||
if (sgotloc_size != section_size)
|
if (sgotloc_size != section_size)
|
||||||
|
{
|
||||||
|
(*_bfd_error_handler)
|
||||||
|
("internal inconsistency in size of .got.loc section");
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
contents = (bfd_byte *) bfd_malloc (section_size);
|
contents = (bfd_byte *) bfd_malloc (section_size);
|
||||||
table = (property_table_entry *)
|
table = (property_table_entry *)
|
||||||
@ -2479,8 +2480,7 @@ elf_xtensa_finish_dynamic_sections (output_bfd, info)
|
|||||||
BFD_ASSERT (! info->relocatable);
|
BFD_ASSERT (! info->relocatable);
|
||||||
sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit");
|
sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit");
|
||||||
sgotloc = bfd_get_section_by_name (dynobj, ".got.loc");
|
sgotloc = bfd_get_section_by_name (dynobj, ".got.loc");
|
||||||
if (!sxtlit || !sgotloc)
|
BFD_ASSERT (sxtlit && sgotloc);
|
||||||
return FALSE;
|
|
||||||
num_xtlit_entries =
|
num_xtlit_entries =
|
||||||
elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc);
|
elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc);
|
||||||
if (num_xtlit_entries < 0)
|
if (num_xtlit_entries < 0)
|
||||||
@ -2578,7 +2578,7 @@ elf_xtensa_merge_private_bfd_data (ibfd, obfd)
|
|||||||
if (out_mach != in_mach)
|
if (out_mach != in_mach)
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
("%s: incompatible machine type. Output is 0x%x. Input is 0x%x\n",
|
("%s: incompatible machine type. Output is 0x%x. Input is 0x%x",
|
||||||
bfd_archive_filename (ibfd), out_mach, in_mach);
|
bfd_archive_filename (ibfd), out_mach, in_mach);
|
||||||
bfd_set_error (bfd_error_wrong_format);
|
bfd_set_error (bfd_error_wrong_format);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2824,6 +2824,24 @@ elf_xtensa_discard_info_for_section (abfd, cookie, info, sec)
|
|||||||
sec->_cooked_size = section_size - removed_bytes;
|
sec->_cooked_size = section_size - removed_bytes;
|
||||||
/* Also shrink _raw_size. See comments in relax_property_section. */
|
/* Also shrink _raw_size. See comments in relax_property_section. */
|
||||||
sec->_raw_size = sec->_cooked_size;
|
sec->_raw_size = sec->_cooked_size;
|
||||||
|
|
||||||
|
if (xtensa_is_littable_section (sec))
|
||||||
|
{
|
||||||
|
bfd *dynobj = elf_hash_table (info)->dynobj;
|
||||||
|
if (dynobj)
|
||||||
|
{
|
||||||
|
asection *sgotloc =
|
||||||
|
bfd_get_section_by_name (dynobj, ".got.loc");
|
||||||
|
if (sgotloc)
|
||||||
|
{
|
||||||
|
bfd_size_type sgotloc_size =
|
||||||
|
(sgotloc->_cooked_size ? sgotloc->_cooked_size
|
||||||
|
: sgotloc->_raw_size);
|
||||||
|
sgotloc->_cooked_size = sgotloc_size - removed_bytes;
|
||||||
|
sgotloc->_raw_size = sgotloc_size - removed_bytes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3102,7 +3120,7 @@ elf_xtensa_do_asm_simplify (contents, address, content_length)
|
|||||||
if (content_length < address)
|
if (content_length < address)
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
("Attempt to convert L32R/CALLX to CALL failed\n");
|
("Attempt to convert L32R/CALLX to CALL failed");
|
||||||
return bfd_reloc_other;
|
return bfd_reloc_other;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3111,7 +3129,7 @@ elf_xtensa_do_asm_simplify (contents, address, content_length)
|
|||||||
if (direct_call_opcode == XTENSA_UNDEFINED)
|
if (direct_call_opcode == XTENSA_UNDEFINED)
|
||||||
{
|
{
|
||||||
(*_bfd_error_handler)
|
(*_bfd_error_handler)
|
||||||
("Attempt to convert L32R/CALLX to CALL failed\n");
|
("Attempt to convert L32R/CALLX to CALL failed");
|
||||||
return bfd_reloc_other;
|
return bfd_reloc_other;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user