+ return _bfd_elf_adjust_dynamic_copy (info, h, s);
+}
+
+/* This function is called via elf_link_hash_traverse. It resets GOT
+ and PLT (.GOT) reference counts back to -1 so normal PC32 relocation
+ will be done. */
+
+static bfd_boolean
+elf_vax_discard_got_entries (struct elf_link_hash_entry *h,
+ void *infoptr ATTRIBUTE_UNUSED)
+{
+ h->got.refcount = -1;
+ h->plt.refcount = -1;
+
+ return TRUE;
+}
+
+/* Discard unused dynamic data if this is a static link. */
+
+static bfd_boolean
+elf_vax_always_size_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info)
+{
+ bfd *dynobj;
+ asection *s;
+
+ dynobj = elf_hash_table (info)->dynobj;
+
+ if (dynobj && !elf_hash_table (info)->dynamic_sections_created)
+ {
+ /* We may have created entries in the .rela.got and .got sections.
+ However, if we are not creating the dynamic sections, we will
+ not actually use these entries. Reset the size of .rela.got
+ and .got, which will cause them to get stripped from the output
+ file below. */
+ s = elf_hash_table (info)->srelgot;
+ if (s != NULL)
+ s->size = 0;
+ s = elf_hash_table (info)->sgotplt;
+ if (s != NULL)
+ s->size = 0;
+ s = elf_hash_table (info)->sgot;
+ if (s != NULL)
+ s->size = 0;
+ }
+
+ /* If this is a static link, we need to discard all the got entries we've
+ recorded. */
+ if (!dynobj || !elf_hash_table (info)->dynamic_sections_created)
+ elf_link_hash_traverse (elf_hash_table (info),
+ elf_vax_discard_got_entries,
+ info);
+
+ return TRUE;