+/* Create a symbol with the given name with the value of the
+ address of first byte of the section named.
+
+ If the symbol already exists, then do nothing. */
+
+static void
+symbol_at_beginning_of (const char *secname, const char *name)
+{
+ struct bfd_link_hash_entry *h;
+
+ h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE);
+ if (h == NULL)
+ einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
+
+ if (h->type == bfd_link_hash_new
+ || h->type == bfd_link_hash_undefined)
+ {
+ asection *sec;
+
+ h->type = bfd_link_hash_defined;
+
+ sec = bfd_get_section_by_name (link_info.output_bfd, secname);
+ if (sec == NULL)
+ sec = bfd_abs_section_ptr;
+ h->u.def.value = 0;
+ h->u.def.section = sec;
+ }
+}
+
+/* Create a symbol with the given name with the value of the
+ address of the first byte after the end of the section named.
+
+ If the symbol already exists, then do nothing. */
+
+static void
+symbol_at_end_of (const char *secname, const char *name)
+{
+ struct bfd_link_hash_entry *h;
+
+ h = bfd_link_hash_lookup (link_info.hash, name, TRUE, TRUE, TRUE);
+ if (h == NULL)
+ einfo (_("%P%F: bfd_link_hash_lookup failed: %E\n"));
+
+ if (h->type == bfd_link_hash_new
+ || h->type == bfd_link_hash_undefined)
+ {
+ asection *sec;
+
+ h->type = bfd_link_hash_defined;
+
+ sec = bfd_get_section_by_name (link_info.output_bfd, secname);
+ if (sec == NULL)
+ sec = bfd_abs_section_ptr;
+ h->u.def.value = sec->size;
+ h->u.def.section = sec;
+ }
+}
+