+/* Set SYM_NAME to VAL if the symbol exists and is undefined. */
+
+static void
+set_linker_sym (struct ppc_elf_link_hash_table *htab,
+ const char *sym_name,
+ bfd_vma val)
+{
+ struct elf_link_hash_entry *h;
+ h = elf_link_hash_lookup (&htab->elf, sym_name, FALSE, FALSE, FALSE);
+ if (h != NULL && h->root.type == bfd_link_hash_undefined)
+ {
+ h->root.type = bfd_link_hash_defined;
+ h->root.u.def.section = bfd_abs_section_ptr;
+ h->root.u.def.value = val;
+ h->def_regular = 1;
+ h->type = STT_OBJECT;
+ h->other = STV_HIDDEN;
+ }
+}
+
+/* Set _SDA_BASE_, _SDA2_BASE, and sbss start and end syms. They are
+ set here rather than via PROVIDE in the default linker script,
+ because using PROVIDE inside an output section statement results in
+ unnecessary output sections. Using PROVIDE outside an output section
+ statement runs the risk of section alignment affecting where the
+ section starts. */