+
+/* Return a freshly allocated copy of ADDRS. The section names, if
+ any, are also freshly allocated copies of those in ADDRS. */
+struct section_addr_info *
+copy_section_addr_info (struct section_addr_info *addrs)
+{
+ struct section_addr_info *copy
+ = alloc_section_addr_info (addrs->num_sections);
+ int i;
+
+ copy->num_sections = addrs->num_sections;
+ for (i = 0; i < addrs->num_sections; i++)
+ {
+ copy->other[i].addr = addrs->other[i].addr;
+ if (addrs->other[i].name)
+ copy->other[i].name = xstrdup (addrs->other[i].name);
+ else
+ copy->other[i].name = NULL;
+ copy->other[i].sectindex = addrs->other[i].sectindex;
+ }
+
+ return copy;
+}
+
+
+