diff options
author | Nick Clifton <nickc@redhat.com> | 2013-06-11 07:21:40 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2013-06-11 07:21:40 +0000 |
commit | af9c3a2131df0c503c6690a9714c4d0789b8dc34 (patch) | |
tree | 0b892bf58606151bd2d1865d99965c892df3306c | |
parent | 797762181b423ce0f245561bd4e4ba7ff5c38197 (diff) | |
download | binutils-redhat-af9c3a2131df0c503c6690a9714c4d0789b8dc34.tar.gz |
* elf32-rl78.c (rl78_elf_finish_dynamic_sections): Onlly run
checks if the dynamic sections have been created and relaxation
has not been performed.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf32-rl78.c | 24 |
2 files changed, 20 insertions, 10 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index baff095944..cfe54f93f6 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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> * configure: Regenerate. diff --git a/bfd/elf32-rl78.c b/bfd/elf32-rl78.c index 11d1ecc745..fb31176da0 100644 --- a/bfd/elf32-rl78.c +++ b/bfd/elf32-rl78.c @@ -1270,24 +1270,28 @@ rl78_elf_finish_dynamic_sections (bfd *abfd ATTRIBUTE_UNUSED, bfd *dynobj; asection *splt; + if (!elf_hash_table (info)->dynamic_sections_created) + return TRUE; + /* As an extra sanity check, verify that all plt entries have been filled in. However, relaxing might have changed the relocs so that some plt entries don't get filled in, so we have to skip this check if we're relaxing. Unfortunately, check_relocs is called before relaxation. */ - if (info->relax_trip > 0) + if (info->relax_trip > 0) + return TRUE; + + if ((dynobj = elf_hash_table (info)->dynobj) != NULL + && (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL) { - if ((dynobj = elf_hash_table (info)->dynobj) != NULL - && (splt = bfd_get_linker_section (dynobj, ".plt")) != NULL) + bfd_byte *contents = splt->contents; + unsigned int i, size = splt->size; + + for (i = 0; i < size; i += 4) { - bfd_byte *contents = splt->contents; - unsigned int i, size = splt->size; - for (i = 0; i < size; i += 4) - { - unsigned int x = bfd_get_32 (dynobj, contents + i); - BFD_ASSERT (x != 0); - } + unsigned int x = bfd_get_32 (dynobj, contents + i); + BFD_ASSERT (x != 0); } } |