+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>
* elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when
The actual PLT code must be split into multiple sections and all
the sections have to be created before size_dynamic_sections,
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. */
static int plt_reloc_count = 0;
continue;
for (s = abfd->sections; s != NULL; s = s->next)
{
- /* Skip input sections that are being discarded. */
- if (!bfd_is_abs_section (s)
- && bfd_is_abs_section (s->output_section))
- continue;
-
- if (xtensa_is_littable_section (s) && s != spltlittbl)
+ if (! elf_discarded_section (s)
+ && xtensa_is_littable_section (s)
+ && s != spltlittbl)
sgotloc->_raw_size += s->_raw_size;
}
}
sgotloc_size = (sgotloc->_cooked_size != 0
? sgotloc->_cooked_size : sgotloc->_raw_size);
if (sgotloc_size != section_size)
- return -1;
+ {
+ (*_bfd_error_handler)
+ ("internal inconsistency in size of .got.loc section");
+ return -1;
+ }
contents = (bfd_byte *) bfd_malloc (section_size);
table = (property_table_entry *)
BFD_ASSERT (! info->relocatable);
sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit");
sgotloc = bfd_get_section_by_name (dynobj, ".got.loc");
- if (!sxtlit || !sgotloc)
- return FALSE;
+ BFD_ASSERT (sxtlit && sgotloc);
num_xtlit_entries =
elf_xtensa_combine_prop_entries (output_bfd, sxtlit, sgotloc);
if (num_xtlit_entries < 0)
if (out_mach != in_mach)
{
(*_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_set_error (bfd_error_wrong_format);
return FALSE;
sec->_cooked_size = section_size - removed_bytes;
/* Also shrink _raw_size. See comments in relax_property_section. */
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
{
if (content_length < address)
{
(*_bfd_error_handler)
- ("Attempt to convert L32R/CALLX to CALL failed\n");
+ ("Attempt to convert L32R/CALLX to CALL failed");
return bfd_reloc_other;
}
if (direct_call_opcode == XTENSA_UNDEFINED)
{
(*_bfd_error_handler)
- ("Attempt to convert L32R/CALLX to CALL failed\n");
+ ("Attempt to convert L32R/CALLX to CALL failed");
return bfd_reloc_other;
}