bfd_map_over_sections (stdoutput, coff_adjust_section_syms, NULL);
}
+/* Set relocations for the section and then store the number of relocations
+ in its aux entry. */
+
+void
+obj_coff_set_section_relocs (asection *sec, arelent **relocs, unsigned int n)
+{
+ symbolS *sect_sym;
+
+ bfd_set_reloc (stdoutput, sec, n ? relocs : NULL, n);
+ sect_sym = section_symbol (sec);
+#ifdef OBJ_XCOFF
+ if (S_GET_STORAGE_CLASS (sect_sym) == C_DWARF)
+ SA_SET_SECT_NRELOC (sect_sym, n);
+ else
+#endif
+ SA_SET_SCN_NRELOC (sect_sym, n);
+}
+
/* Implement the .section pseudo op:
.section name {, "flags"}
^ ^
information. */
#define INIT_STAB_SECTION(stab, str) obj_coff_init_stab_section (stab, str)
-/* Store the number of relocations in the section aux entry. */
-#ifdef OBJ_XCOFF
-#define SET_SECTION_RELOCS(sec, relocs, n) \
- do { \
- symbolS * sectSym = section_symbol (sec); \
- if (S_GET_STORAGE_CLASS (sectSym) == C_DWARF) \
- SA_SET_SECT_NRELOC (sectSym, n); \
- else \
- SA_SET_SCN_NRELOC (sectSym, n); \
- } while (0)
-#else
+/* We need to store the number of relocations in the section aux entry. */
#define SET_SECTION_RELOCS(sec, relocs, n) \
- SA_SET_SCN_NRELOC (section_symbol (sec), n)
-#endif
+ obj_coff_set_section_relocs (sec, relocs, n)
+extern void obj_coff_set_section_relocs (asection *, arelent **, unsigned int);
extern int S_SET_DATA_TYPE (symbolS *, int);
extern int S_SET_STORAGE_CLASS (symbolS *, int);
@item SET_SECTION_RELOCS (@var{sec}, @var{relocs}, @var{n})
@cindex SET_SECTION_RELOCS
-If you define this, it will be called after the relocations have been set for
-the section @var{sec}. The list of relocations is in @var{relocs}, and the
-number of relocations is in @var{n}.
+If you define this, it will be called to set relocations for the section
+@var{sec}. The list of relocations is in @var{relocs}, and the number of
+relocations is in @var{n}.
@end table
@node Emulations
#include "compress-debug.h"
#include "codeview.h"
+#ifndef SET_SECTION_RELOCS
+#define SET_SECTION_RELOCS(sec, relocs, n) \
+ bfd_set_reloc (stdoutput, sec, n ? relocs : NULL, n)
+#endif
+
#ifndef TC_FORCE_RELOCATION
#define TC_FORCE_RELOCATION(FIX) \
(generic_force_reloc (FIX))
}
#endif
- bfd_set_reloc (stdoutput, sec, n ? relocs : NULL, n);
-
-#ifdef SET_SECTION_RELOCS
SET_SECTION_RELOCS (sec, relocs, n);
-#endif
#ifdef DEBUG3
{