aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2013-02-12 09:54:56 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2013-02-12 09:54:56 +0000
commit57093f5e8089ca3de7cf3990454ab577a9cec06c (patch)
treea7f37169fac5e04e041a67f437e5e1849fa1c977 /bfd/elfxx-mips.c
parentb65a2bd9297dcbdb55c0a84e38246553b5255ac7 (diff)
downloadgdb-57093f5e8089ca3de7cf3990454ab577a9cec06c.zip
gdb-57093f5e8089ca3de7cf3990454ab577a9cec06c.tar.gz
gdb-57093f5e8089ca3de7cf3990454ab577a9cec06c.tar.bz2
bfd/
* elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs in g->relocs.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 00757ff..1d4586f 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -8649,20 +8649,7 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
/* VxWorks does not support multiple GOTs. It initializes $gp to
__GOTT_BASE__[__GOTT_INDEX__], the value of which is set by the
dynamic loader. */
- if (htab->is_vxworks)
- {
- /* VxWorks executables do not need a GOT. */
- if (info->shared)
- {
- /* Each VxWorks GOT entry needs an explicit relocation. */
- unsigned int count;
-
- count = g->global_gotno + g->local_gotno - htab->reserved_gotno;
- if (count)
- mips_elf_allocate_dynamic_relocations (dynobj, info, count);
- }
- }
- else if (s->size > MIPS_ELF_GOT_MAX_SIZE (info))
+ if (!htab->is_vxworks && s->size > MIPS_ELF_GOT_MAX_SIZE (info))
{
if (!mips_elf_multi_got (output_bfd, info, s, page_gotno))
return FALSE;
@@ -8687,6 +8674,10 @@ mips_elf_lay_out_got (bfd *output_bfd, struct bfd_link_info *info)
BFD_ASSERT (g->tls_assigned_gotno
== g->global_gotno + g->local_gotno + g->tls_gotno);
+ /* Each VxWorks GOT entry needs an explicit relocation. */
+ if (htab->is_vxworks && info->shared)
+ g->relocs += g->global_gotno + g->local_gotno - htab->reserved_gotno;
+
/* Allocate room for the TLS relocations. */
if (g->relocs)
mips_elf_allocate_dynamic_relocations (dynobj, info, g->relocs);