aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-cris.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2013-10-18 02:37:51 +0000
committerHans-Peter Nilsson <hp@axis.com>2013-10-18 02:37:51 +0000
commit6dd38d7935978de2a692f3042333a879eef18374 (patch)
tree3de7715996e98f6292e0c0f2fad021739bcfa7e1 /bfd/elf32-cris.c
parent0c6faab597cd4a4fc5cc61d312899fd143473d87 (diff)
downloadgdb-6dd38d7935978de2a692f3042333a879eef18374.zip
gdb-6dd38d7935978de2a692f3042333a879eef18374.tar.gz
gdb-6dd38d7935978de2a692f3042333a879eef18374.tar.bz2
* elf32-cris.c (cris_elf_check_relocs): Don't assume
a registered dynobj means that a .got has been created.
Diffstat (limited to 'bfd/elf32-cris.c')
-rw-r--r--bfd/elf32-cris.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index f40a079..f35292e 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)
{