diff options
author | Alan Modra <amodra@gmail.com> | 2011-12-03 10:29:01 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2011-12-03 10:29:01 +0000 |
commit | be7b303d27c7f45f989ac6f2b348c5311a66119d (patch) | |
tree | ad17fb587a2cff74dc9e2f70d2e95aa41ab1ab87 /bfd | |
parent | 68ba6d402de919a43e3def82bc24d85d7c2ed04e (diff) | |
download | gdb-be7b303d27c7f45f989ac6f2b348c5311a66119d.zip gdb-be7b303d27c7f45f989ac6f2b348c5311a66119d.tar.gz gdb-be7b303d27c7f45f989ac6f2b348c5311a66119d.tar.bz2 |
PR ld/13468
* elflink.c (bfd_elf_final_link): Don't segfault when checking
for DT_TEXTREL and .dynamic does not exist.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elflink.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 12c332a..77d6ad8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2011-12-03 Alan Modra <amodra@gmail.com> + PR ld/13468 + * elflink.c (bfd_elf_final_link): Don't segfault when checking + for DT_TEXTREL and .dynamic does not exist. + +2011-12-03 Alan Modra <amodra@gmail.com> + PR ld/13470 * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive change in 2011-07-01 commit. Comment. diff --git a/bfd/elflink.c b/bfd/elflink.c index 3448bfc..ac95c22 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -11188,15 +11188,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) goto error_return; /* Check for DT_TEXTREL (late, in case the backend removes it). */ - if ((info->warn_shared_textrel && info->shared) - || info->error_textrel) + if (((info->warn_shared_textrel && info->shared) + || info->error_textrel) + && (o = bfd_get_section_by_name (dynobj, ".dynamic")) != NULL) { bfd_byte *dyncon, *dynconend; - /* Fix up .dynamic entries. */ - o = bfd_get_section_by_name (dynobj, ".dynamic"); - BFD_ASSERT (o != NULL); - dyncon = o->contents; dynconend = o->contents + o->size; for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn) |