* elf32-cris.c (cris_elf_check_relocs): Don't assume

a registered dynobj means that a .got has been created.
This commit is contained in:
Hans-Peter Nilsson 2013-10-18 02:37:51 +00:00
parent 0c6faab597
commit 6dd38d7935
2 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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 (!_bfd_elf_create_got_section (dynobj, info))
return FALSE;
}
if (sgot == NULL)
sgot = bfd_get_linker_section (dynobj, ".got");
{
/* 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;
sgot = bfd_get_linker_section (dynobj, ".got");
}
if (local_got_refcounts == NULL)
{