* elf32-rl78.c (rl78_elf_finish_dynamic_sections): Onlly run

checks if the dynamic sections have been created and relaxation
	has not been performed.
This commit is contained in:
Nick Clifton
2013-06-11 07:21:40 +00:00
parent c933105541
commit 47fc0f1f21
2 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2013-06-11 Nick Clifton <nickc@redhat.com>
* elf32-rl78.c (rl78_elf_finish_dynamic_sections): Onlly run
checks if the dynamic sections have been created and relaxation
has not been performed.
2013-06-07 Will Newton <will.newton@linaro.org> 2013-06-07 Will Newton <will.newton@linaro.org>
* configure: Regenerate. * configure: Regenerate.

View File

@ -1270,6 +1270,9 @@ rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED,
bfd *dynobj; bfd *dynobj;
asection *splt; asection *splt;
if (!elf_hash_table (info)->dynamic_sections_created)
return TRUE;
/* As an extra sanity check, verify that all plt entries have been /* As an extra sanity check, verify that all plt entries have been
filled in. However, relaxing might have changed the relocs so filled in. However, relaxing might have changed the relocs so
that some plt entries don't get filled in, so we have to skip that some plt entries don't get filled in, so we have to skip
@ -1277,19 +1280,20 @@ rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED,
called before relaxation. */ called before relaxation. */
if (info->relax_trip > 0) if (info->relax_trip > 0)
{ return TRUE;
if ((dynobj = elf_hash_table (info)->dynobj) != NULL if ((dynobj = elf_hash_table (info)->dynobj) != NULL
&& (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL) && (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL)
{ {
bfd_byte *contents = splt->contents; bfd_byte *contents = splt->contents;
unsigned int i, size = splt->size; unsigned int i, size = splt->size;
for (i = 0; i < size; i += 4) for (i = 0; i < size; i += 4)
{ {
unsigned int x = bfd_get_32 (dynobj, contents + i); unsigned int x = bfd_get_32 (dynobj, contents + i);
BFD_ASSERT (x != 0); BFD_ASSERT (x != 0);
} }
} }
}
return TRUE; return TRUE;
} }