* section.c (bfd_get_section_contents): Put in parens to get
[deliverable/binutils-gdb.git] / bfd / libcoff-in.h
CommitLineData
075caafd 1/* BFD COFF object file private structure.
326e32d7 2 Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
075caafd
ILT
3 Written by Cygnus Support.
4
5This file is part of BFD, the Binary File Descriptor library.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21
22/* Object file tdata; access macros */
23
24#define coff_data(bfd) ((bfd)->tdata.coff_obj_data)
25#define exec_hdr(bfd) (coff_data(bfd)->hdr)
26#define obj_symbols(bfd) (coff_data(bfd)->symbols)
27#define obj_sym_filepos(bfd) (coff_data(bfd)->sym_filepos)
28
29#define obj_relocbase(bfd) (coff_data(bfd)->relocbase)
30#define obj_raw_syments(bfd) (coff_data(bfd)->raw_syments)
326e32d7 31#define obj_raw_syment_count(bfd) (coff_data(bfd)->raw_syment_count)
075caafd
ILT
32#define obj_convert(bfd) (coff_data(bfd)->conversion_table)
33#define obj_conv_table_size(bfd) (coff_data(bfd)->conv_table_size)
34#if CFILE_STUFF
35#define obj_symbol_slew(bfd) (coff_data(bfd)->symbol_index_slew)
36#else
37#define obj_symbol_slew(bfd) 0
38#endif
39
40
41/* `Tdata' information kept for COFF files. */
42
43typedef struct coff_tdata
44{
45 struct coff_symbol_struct *symbols; /* symtab for input bfd */
46 unsigned int *conversion_table;
47 int conv_table_size;
48 file_ptr sym_filepos;
49
50 long symbol_index_slew; /* used during read to mark whether a
51 C_FILE symbol as been added. */
52
53 struct coff_ptr_struct *raw_syments;
54 struct lineno *raw_linenos;
55 unsigned int raw_syment_count;
56 unsigned short flags;
57
58 /* These are only valid once writing has begun */
59 long int relocbase;
60
61 /* These members communicate important constants about the symbol table
62 to GDB's symbol-reading code. These `constants' unfortunately vary
63 from coff implementation to implementation... */
64 unsigned local_n_btmask;
65 unsigned local_n_btshft;
66 unsigned local_n_tmask;
67 unsigned local_n_tshift;
68 unsigned local_symesz;
69 unsigned local_auxesz;
70 unsigned local_linesz;
71} coff_data_type;
72
73/* We take the address of the first element of a asymbol to ensure that the
74 * macro is only ever applied to an asymbol. */
75#define coffsymbol(asymbol) ((coff_symbol_type *)(&((asymbol)->the_bfd)))
76
77/* Functions in coffgen.c. */
78extern bfd_target *coff_object_p PARAMS ((bfd *));
79extern struct sec *coff_section_from_bfd_index PARAMS ((bfd *, int));
326e32d7
ILT
80extern long coff_get_symtab_upper_bound PARAMS ((bfd *));
81extern long coff_get_symtab PARAMS ((bfd *, asymbol **));
82extern int coff_count_linenumbers PARAMS ((bfd *));
075caafd 83extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *));
326e32d7 84extern boolean coff_renumber_symbols PARAMS ((bfd *));
075caafd
ILT
85extern void coff_mangle_symbols PARAMS ((bfd *));
86extern void coff_write_symbols PARAMS ((bfd *));
326e32d7 87extern boolean coff_write_linenumbers PARAMS ((bfd *));
075caafd
ILT
88extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *));
89extern asymbol *coff_section_symbol PARAMS ((bfd *, char *));
90extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *));
326e32d7 91extern long coff_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr));
075caafd
ILT
92extern asymbol *coff_make_empty_symbol PARAMS ((bfd *));
93extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *,
94 bfd_print_symbol_type how));
326e32d7
ILT
95extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *,
96 symbol_info *ret));
97extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR,
98 unsigned long));
075caafd
ILT
99extern boolean coff_find_nearest_line PARAMS ((bfd *,
100 asection *,
101 asymbol **,
102 bfd_vma offset,
103 CONST char **filename_ptr,
104 CONST char **functionname_ptr,
105 unsigned int *line_ptr));
106extern int coff_sizeof_headers PARAMS ((bfd *, boolean reloc));
326e32d7
ILT
107extern boolean bfd_coff_reloc16_relax_section
108 PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *));
075caafd 109extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents
326e32d7
ILT
110 PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *,
111 bfd_byte *, boolean relocateable, asymbol **));
075caafd 112extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *,
326e32d7
ILT
113 struct bfd_link_info *,
114 asection *));
115extern void bfd_perform_slip PARAMS ((bfd *abfd, unsigned int slip,
116 asection *input_section,
117 bfd_vma val));
075caafd
ILT
118
119/* And more taken from the source .. */
120
This page took 0.089747 seconds and 4 git commands to generate.