gdb/
[deliverable/binutils-gdb.git] / gdb / exec.c
index 938b106adefd0f4f5c60cca0e964dfe128231fa0..60e3b36ae3cbc5bacc0559864d1f771222c45665 100644 (file)
@@ -670,6 +670,27 @@ set_section_command (char *args, int from_tty)
   error (_("Section %s not found"), secprint);
 }
 
+/* If we can find a section in FILENAME with BFD index INDEX, and the
+   user has not assigned an address to it yet (via "set section"), adjust it
+   to ADDRESS.  */
+
+void
+exec_set_section_address (const char *filename, int index, CORE_ADDR address)
+{
+  struct section_table *p;
+
+  for (p = exec_ops.to_sections; p < exec_ops.to_sections_end; p++)
+    {
+      if (strcmp (filename, p->bfd->filename) == 0
+         && index == p->the_bfd_section->index
+         && p->addr == 0)
+       {
+         p->addr = address;
+         p->endaddr += address;
+       }
+    }
+}
+
 /* If mourn is being called in all the right places, this could be say
    `gdb internal error' (since generic_mourn calls
    breakpoint_init_inferior).  */
This page took 0.180512 seconds and 4 git commands to generate.