From af44cfd797aaaab285666ba6115e228402c4fa50 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 12 Sep 1999 03:44:42 +0000 Subject: [PATCH] * write.c (write_relocs): Call SET_SECTION_RELOCS if it is defined. * config/obj-coff.h (SET_SECTION_RELOCS): Define. * doc/internals.texi (Object format backend): Document SET_SECTION_RELOCS. --- gas/ChangeLog | 6 ++++++ gas/config/obj-coff.c | 2 ++ gas/config/obj-coff.h | 4 ++++ gas/doc/internals.texi | 7 +++++++ gas/write.c | 4 ++++ 5 files changed, 23 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index c41533d51..c8da33814 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -5,6 +5,12 @@ 1999-09-11 Donn Terry + * write.c (write_relocs): Call SET_SECTION_RELOCS if it is + defined. + * config/obj-coff.h (SET_SECTION_RELOCS): Define. + * doc/internals.texi (Object format backend): Document + SET_SECTION_RELOCS. + * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust relocations against global symbols if TE_PE. diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index aa1ff290f..3bdc73ce9 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1314,6 +1314,8 @@ coff_adjust_section_syms (abfd, sec, x) && sec != bss_section) return; secsym = section_symbol (sec); + /* This is an estimate; we'll plug in the real value using + SET_SECTION_RELOCS later */ SA_SET_SCN_NRELOC (secsym, nrelocs); SA_SET_SCN_NLINNO (secsym, nlnno); } diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index a8799a318..16d7986ec 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -841,4 +841,8 @@ extern void obj_coff_pe_handle_link_once (); extern void obj_coff_init_stab_section PARAMS ((segT)); #define INIT_STAB_SECTION(seg) obj_coff_init_stab_section (seg) +/* 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_FORMAT_H */ diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index 7f9210503..6dc9ac7c6 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -1374,6 +1374,13 @@ completed, but before the relocations have been generated. @item obj_frob_file_after_relocs If you define this macro, GAS will call it after the relocs have been generated. + +@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}. This is only used with +@code{BFD_ASSEMBLER}. @end table @node Emulations diff --git a/gas/write.c b/gas/write.c index 20fdde060..e386ece34 100644 --- a/gas/write.c +++ b/gas/write.c @@ -1068,6 +1068,10 @@ write_relocs (abfd, sec, xxx) (bfd_get_section_flags (abfd, sec) & (flagword) ~SEC_RELOC)); +#ifdef SET_SECTION_RELOCS + SET_SECTION_RELOCS (sec, relocs, n); +#endif + #ifdef DEBUG3 { int i; -- 2.11.4.GIT