+struct saved_offsets
+{
+ unsigned int section_count;
+ struct saved_output_info *sections;
+};
+
+/* The sections in ABFD may already have output sections and offsets
+ set if we are here during linking.
+
+ DWARF-2 specifies offsets into debug sections in many cases and
+ bfd_simple_get_relocated_section_contents is called to relocate
+ debug info for a single relocatable object file. So we want
+ offsets relative to that object file's sections, not offsets in the
+ output file. For that reason, reset a debug section->output_offset
+ to zero.
+
+ If not called during linking then set section->output_section to
+ point back to the input section, because output_section must not be
+ NULL when calling the relocation routines.
+
+ Save the original output offset and section to restore later. */
+