From 645ea3ea629261e7e66127db1438f64019fd5d08 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 25 Oct 2010 12:38:42 +0000 Subject: [PATCH] * obj.h (struct format_ops): Add adjust_symtab. * config/obj-multi.h (obj_adjust_symtab): Define. * config/obj-aout.c (aout_format_ops): Init new field. * config/obj-coff.c (coff_format_ops): Likewise. * config/obj-ecoff.c (ecoff_format_ops): Likewise. * config/obj-elf.c (elf_format_ops): Likewise. --- gas/ChangeLog | 9 +++++++++ gas/config/obj-aout.c | 5 +++-- gas/config/obj-coff.c | 3 ++- gas/config/obj-ecoff.c | 5 +++-- gas/config/obj-elf.c | 3 ++- gas/config/obj-multi.h | 7 ++++++- gas/obj.h | 3 ++- 7 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 020f927..121be85 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2010-10-25 Mark Mitchell + + * obj.h (struct format_ops): Add adjust_symtab. + * config/obj-multi.h (obj_adjust_symtab): Define. + * config/obj-aout.c (aout_format_ops): Init new field. + * config/obj-coff.c (coff_format_ops): Likewise. + * config/obj-ecoff.c (ecoff_format_ops): Likewise. + * config/obj-elf.c (elf_format_ops): Likewise. + 2010-10-25 Alan Modra PR gas/12049 diff --git a/gas/config/obj-aout.c b/gas/config/obj-aout.c index 366fc5b..32c68aa 100644 --- a/gas/config/obj-aout.c +++ b/gas/config/obj-aout.c @@ -309,8 +309,9 @@ const struct format_ops aout_format_ops = aout_pop_insert, 0, /* ecoff_set_ext. */ 0, /* read_begin_hook. */ - 0, /* symbol_new_hook. */ - 0 /* symbol_clone_hook. */ + 0, /* symbol_new_hook. */ + 0, /* symbol_clone_hook. */ + 0 /* adjust_symtab. */ }; const pseudo_typeS aout_pseudo_table[] = diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index d0a4999..04695ba 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1943,5 +1943,6 @@ const struct format_ops coff_format_ops = 0, /* ecoff_set_ext */ coff_obj_read_begin_hook, coff_obj_symbol_new_hook, - coff_obj_symbol_clone_hook + coff_obj_symbol_clone_hook, + coff_obj_adjust_symtab }; diff --git a/gas/config/obj-ecoff.c b/gas/config/obj-ecoff.c index ad9f250..a3e5308 100644 --- a/gas/config/obj-ecoff.c +++ b/gas/config/obj-ecoff.c @@ -1,6 +1,6 @@ /* ECOFF object file format. Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, - 2005, 2007, 2009 Free Software Foundation, Inc. + 2005, 2007, 2009, 2010 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor . @@ -315,5 +315,6 @@ const struct format_ops ecoff_format_ops = ecoff_set_ext, ecoff_read_begin_hook, ecoff_symbol_new_hook, - ecoff_symbol_clone_hook + ecoff_symbol_clone_hook, + 0 /* adjust_symtab. */ }; diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 9f73616..79f8033 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -2446,5 +2446,6 @@ const struct format_ops elf_format_ops = #endif elf_obj_read_begin_hook, elf_obj_symbol_new_hook, - 0 + 0, + elf_adjust_symtab }; diff --git a/gas/config/obj-multi.h b/gas/config/obj-multi.h index b78e836..353162e 100644 --- a/gas/config/obj-multi.h +++ b/gas/config/obj-multi.h @@ -1,5 +1,5 @@ /* Multiple object format emulation. - Copyright 1995, 1996, 1997, 1999, 2000, 2002, 2004, 2005, 2007, 2009 + Copyright 1995, 1996, 1997, 1999, 2000, 2002, 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -91,6 +91,11 @@ ? (*this_format->sec_sym_ok_for_reloc) (A) \ : 0) +#define obj_adjust_symtab() \ + (this_format->adjust_symtab \ + ? (*this_format->adjust_symtab) () \ + : (void) 0) + #define S_GET_SIZE \ (*this_format->s_get_size) diff --git a/gas/obj.h b/gas/obj.h index 7dc33e6..c2d4836 100644 --- a/gas/obj.h +++ b/gas/obj.h @@ -2,7 +2,7 @@ format backends. Copyright 1987, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999, 2000, - 2002, 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2007, 2009, 2010 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -72,6 +72,7 @@ struct format_ops { void (*read_begin_hook) (void); void (*symbol_new_hook) (symbolS *); void (*symbol_clone_hook) (symbolS *, symbolS *); + void (*adjust_symtab) (void); }; extern const struct format_ops elf_format_ops; -- 2.7.4