Index: gas/obj.h =================================================================== RCS file: /cvs/src/src/gas/obj.h,v retrieving revision 1.11 diff -p -u -r1.11 obj.h --- gas/obj.h 11 Aug 2005 01:25:20 -0000 1.11 +++ gas/obj.h 30 Apr 2006 17:44:37 -0000 @@ -44,6 +44,7 @@ struct format_ops { unsigned emit_section_symbols : 1; void (*begin) (void); void (*app_file) (const char *, int); + void (*obj_sec_set_private_data) (bfd *, segT); void (*frob_symbol) (symbolS *, int *); void (*frob_file) (void); void (*frob_file_before_adjust) (void); cvs diff: Diffing gas/config Index: gas/config/obj-aout.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-aout.c,v retrieving revision 1.24 diff -p -u -r1.24 obj-aout.c --- gas/config/obj-aout.c 11 Aug 2005 01:25:24 -0000 1.24 +++ gas/config/obj-aout.c 30 Apr 2006 17:44:37 -0000 @@ -286,6 +286,7 @@ const struct format_ops aout_format_ops 0, /* emit_section_symbols. */ 0, /* begin. */ 0, /* app_file. */ + 0, /* obj_sec_set_private_data. */ obj_aout_frob_symbol, 0, /* frob_file. */ 0, /* frob_file_before_adjust. */ Index: gas/config/obj-coff.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-coff.c,v retrieving revision 1.91 diff -p -u -r1.91 obj-coff.c --- gas/config/obj-coff.c 23 Apr 2006 22:12:43 -0000 1.91 +++ gas/config/obj-coff.c 30 Apr 2006 17:44:39 -0000 @@ -1828,6 +1828,7 @@ const struct format_ops coff_format_ops 1, /* emit_section_symbols */ 0, /* begin */ c_dot_file_symbol, + 0, /* obj_sec_set_private_data. */ coff_frob_symbol, 0, /* frob_file */ 0, /* frob_file_before_adjust */ Index: gas/config/obj-ecoff.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-ecoff.c,v retrieving revision 1.16 diff -p -u -r1.16 obj-ecoff.c --- gas/config/obj-ecoff.c 5 May 2005 09:12:52 -0000 1.16 +++ gas/config/obj-ecoff.c 30 Apr 2006 17:44:40 -0000 @@ -290,6 +290,7 @@ const struct format_ops ecoff_format_ops 1, /* emit_section_symbols. */ 0, /* begin. */ ecoff_new_file, + 0, /* obj_sec_set_private_data. */ obj_ecoff_frob_symbol, ecoff_frob_file, 0, /* frob_file_before_adjust. */ Index: gas/config/obj-elf.c =================================================================== RCS file: /cvs/src/src/gas/config/obj-elf.c,v retrieving revision 1.96 diff -p -u -r1.96 obj-elf.c --- gas/config/obj-elf.c 20 Sep 2005 18:24:44 -0000 1.96 +++ gas/config/obj-elf.c 30 Apr 2006 17:44:42 -0000 @@ -196,6 +196,15 @@ elf_begin (void) elf_com_section_ptr = bfd_com_section_ptr; } +/* ELF needs to set the private data for each new section. */ +void +elf_obj_sec_set_private_data (bfd *abfd, segT seg) +{ + if (!BFD_SEND (abfd, _new_section_hook, (abfd, seg))) + as_fatal (_("can't allocate ELF private section data: %s"), + bfd_errmsg (bfd_get_error ())); +} + void elf_pop_insert (void) { @@ -2230,6 +2239,7 @@ const struct format_ops elf_format_ops = 1, /* emit_section_symbols */ elf_begin, elf_file_symbol, + elf_obj_sec_set_private_data, elf_frob_symbol, elf_frob_file, elf_frob_file_before_adjust, Index: gas/config/obj-elf.h =================================================================== RCS file: /cvs/src/src/gas/config/obj-elf.h,v retrieving revision 1.28 diff -p -u -r1.28 obj-elf.h --- gas/config/obj-elf.h 20 Sep 2005 18:24:45 -0000 1.28 +++ gas/config/obj-elf.h 30 Apr 2006 17:44:42 -0000 @@ -134,12 +134,10 @@ int elf_s_get_other (symbolS *); extern asection *gdb_section; -#ifndef obj_sec_set_private_data -#define obj_sec_set_private_data(B, S) \ - if (! BFD_SEND ((B), _new_section_hook, ((B), (S)))) \ - as_fatal (_("can't allocate ELF private section data: %s"), \ - bfd_errmsg (bfd_get_error ())) -#endif +#ifndef obj_sec_set_private_data +#define obj_sec_set_private_data elf_obj_sec_set_private_data +#endif +extern void elf_obj_sec_set_private_data (bfd *abfd, segT seg); #ifndef obj_frob_file #define obj_frob_file elf_frob_file Index: gas/config/obj-multi.h =================================================================== RCS file: /cvs/src/src/gas/config/obj-multi.h,v retrieving revision 1.12 diff -p -u -r1.12 obj-multi.h --- gas/config/obj-multi.h 5 May 2005 09:12:53 -0000 1.12 +++ gas/config/obj-multi.h 30 Apr 2006 17:44:42 -0000 @@ -42,6 +42,11 @@ ? (*this_format->app_file) (NAME, APPFILE) \ : (void) 0) +#define obj_sec_set_private_data(B, S) \ + (this_format->obj_sec_set_private_data \ + ? (*this_format->obj_sec_set_private_data) ((B), (S)) \ + : (void) 0) + #define obj_frob_symbol(S,P) \ (*this_format->frob_symbol) (S, &(P))