diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2013-10-18 02:37:51 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@axis.com> | 2013-10-18 02:37:51 +0000 |
commit | 0d051bdbc0e2ecf2ed8e0b91dc5c3936e3b1aec0 (patch) | |
tree | 8490f48d6e1e628c3acd2c238182b140ea1d66f7 | |
parent | c927a7bc0089919d82b403376c1fafc3962fb5be (diff) | |
download | binutils-redhat-0d051bdbc0e2ecf2ed8e0b91dc5c3936e3b1aec0.tar.gz |
* elf32-cris.c (cris_elf_check_relocs): Don't assume
a registered dynobj means that a .got has been created.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-cris.c | 15 |
2 files changed, 15 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1f9b698961..89774001c1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2013-10-18 Hans-Peter Nilsson <hp@axis.com> + + * elf32-cris.c (cris_elf_check_relocs): Don't assume + a registered dynobj means that a .got has been created. + 2013-10-17 Alan Modra <amodra@gmail.com> PR 16056 diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c index f40a07963b..f35292ed62 100644 --- a/bfd/elf32-cris.c +++ b/bfd/elf32-cris.c @@ -3236,15 +3236,20 @@ cris_elf_check_relocs (bfd *abfd, abfd, sec); return FALSE; } + } - /* Create the .got section, so we can assume it's always - present whenever there's a dynobj. */ + if (sgot == NULL) + { + /* We may have a dynobj but no .got section, if machine- + independent parts of the linker found a reason to create + a dynobj. We want to create the .got section now, so we + can assume it's always present whenever there's a dynobj. + It's ok to call this function more than once. */ if (!_bfd_elf_create_got_section (dynobj, info)) return FALSE; - } - if (sgot == NULL) - sgot = bfd_get_linker_section (dynobj, ".got"); + sgot = bfd_get_linker_section (dynobj, ".got"); + } if (local_got_refcounts == NULL) { |