xref: /openbsd-src/gnu/usr.bin/binutils-2.17/gas/obj.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* obj.h - defines the object dependent hooks for all object
2*3d8817e4Smiod    format backends.
3*3d8817e4Smiod 
4*3d8817e4Smiod    Copyright 1987, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999, 2000,
5*3d8817e4Smiod    2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6*3d8817e4Smiod 
7*3d8817e4Smiod    This file is part of GAS, the GNU Assembler.
8*3d8817e4Smiod 
9*3d8817e4Smiod    GAS is free software; you can redistribute it and/or modify
10*3d8817e4Smiod    it under the terms of the GNU General Public License as published by
11*3d8817e4Smiod    the Free Software Foundation; either version 2, or (at your option)
12*3d8817e4Smiod    any later version.
13*3d8817e4Smiod 
14*3d8817e4Smiod    GAS is distributed in the hope that it will be useful,
15*3d8817e4Smiod    but WITHOUT ANY WARRANTY; without even the implied warranty of
16*3d8817e4Smiod    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*3d8817e4Smiod    GNU General Public License for more details.
18*3d8817e4Smiod 
19*3d8817e4Smiod    You should have received a copy of the GNU General Public License
20*3d8817e4Smiod    along with GAS; see the file COPYING.  If not, write to the Free
21*3d8817e4Smiod    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22*3d8817e4Smiod    02110-1301, USA.  */
23*3d8817e4Smiod 
24*3d8817e4Smiod char *obj_default_output_file_name (void);
25*3d8817e4Smiod void obj_emit_relocations (char **where, fixS * fixP,
26*3d8817e4Smiod 			   relax_addressT segment_address_in_file);
27*3d8817e4Smiod void obj_emit_strings (char **where);
28*3d8817e4Smiod void obj_emit_symbols (char **where, symbolS * symbols);
29*3d8817e4Smiod #ifndef obj_read_begin_hook
30*3d8817e4Smiod void obj_read_begin_hook (void);
31*3d8817e4Smiod #endif
32*3d8817e4Smiod 
33*3d8817e4Smiod #ifndef obj_symbol_new_hook
34*3d8817e4Smiod void obj_symbol_new_hook (symbolS * symbolP);
35*3d8817e4Smiod #endif
36*3d8817e4Smiod 
37*3d8817e4Smiod void obj_symbol_to_chars (char **where, symbolS * symbolP);
38*3d8817e4Smiod 
39*3d8817e4Smiod extern const pseudo_typeS obj_pseudo_table[];
40*3d8817e4Smiod 
41*3d8817e4Smiod struct format_ops {
42*3d8817e4Smiod   int flavor;
43*3d8817e4Smiod   unsigned dfl_leading_underscore : 1;
44*3d8817e4Smiod   unsigned emit_section_symbols : 1;
45*3d8817e4Smiod   void (*begin) (void);
46*3d8817e4Smiod   void (*app_file) (const char *, int);
47*3d8817e4Smiod   void (*frob_symbol) (symbolS *, int *);
48*3d8817e4Smiod   void (*frob_file) (void);
49*3d8817e4Smiod   void (*frob_file_before_adjust) (void);
50*3d8817e4Smiod   void (*frob_file_before_fix) (void);
51*3d8817e4Smiod   void (*frob_file_after_relocs) (void);
52*3d8817e4Smiod   bfd_vma (*s_get_size) (symbolS *);
53*3d8817e4Smiod   void (*s_set_size) (symbolS *, bfd_vma);
54*3d8817e4Smiod   bfd_vma (*s_get_align) (symbolS *);
55*3d8817e4Smiod   void (*s_set_align) (symbolS *, bfd_vma);
56*3d8817e4Smiod   int (*s_get_other) (symbolS *);
57*3d8817e4Smiod   void (*s_set_other) (symbolS *, int);
58*3d8817e4Smiod   int (*s_get_desc) (symbolS *);
59*3d8817e4Smiod   void (*s_set_desc) (symbolS *, int);
60*3d8817e4Smiod   int (*s_get_type) (symbolS *);
61*3d8817e4Smiod   void (*s_set_type) (symbolS *, int);
62*3d8817e4Smiod   void (*copy_symbol_attributes) (symbolS *, symbolS *);
63*3d8817e4Smiod   void (*generate_asm_lineno) (void);
64*3d8817e4Smiod   void (*process_stab) (segT, int, const char *, int, int, int);
65*3d8817e4Smiod   int (*separate_stab_sections) (void);
66*3d8817e4Smiod   void (*init_stab_section) (segT);
67*3d8817e4Smiod   int (*sec_sym_ok_for_reloc) (asection *);
68*3d8817e4Smiod   void (*pop_insert) (void);
69*3d8817e4Smiod   /* For configurations using ECOFF_DEBUGGING, this callback is used.  */
70*3d8817e4Smiod   void (*ecoff_set_ext) (symbolS *, struct ecoff_extr *);
71*3d8817e4Smiod 
72*3d8817e4Smiod   void (*read_begin_hook) (void);
73*3d8817e4Smiod   void (*symbol_new_hook) (symbolS *);
74*3d8817e4Smiod };
75*3d8817e4Smiod 
76*3d8817e4Smiod extern const struct format_ops elf_format_ops;
77*3d8817e4Smiod extern const struct format_ops ecoff_format_ops;
78*3d8817e4Smiod extern const struct format_ops coff_format_ops;
79*3d8817e4Smiod extern const struct format_ops aout_format_ops;
80*3d8817e4Smiod 
81*3d8817e4Smiod #ifndef this_format
82*3d8817e4Smiod COMMON const struct format_ops *this_format;
83*3d8817e4Smiod #endif
84*3d8817e4Smiod 
85*3d8817e4Smiod /* end of obj.h */
86