This commit was generated by cvs2svn to track changes on a CVS vendor
[platform/upstream/binutils.git] / ld / ld.h
1 /* ld.h -
2
3    Copyright (C) 1991 Free Software Foundation, Inc.
4
5    This file is part of GLD, the Gnu Linker.
6
7    GLD is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 1, or (at your option)
10    any later version.
11
12    GLD is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GLD; see the file COPYING.  If not, write to
19    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21
22 #define flag_is_not_at_end(x) ((x) & BSF_NOT_AT_END)
23 #define flag_is_ordinary_local(x) (((x) & (BSF_LOCAL))&!((x) & (BSF_DEBUGGING)))
24 #define flag_is_debugger(x) ((x) & BSF_DEBUGGING)
25 #define flag_is_undefined_or_global(x) ((x) & (BSF_UNDEFINED | BSF_GLOBAL))
26 #define flag_is_defined(x) (!((x) & (BSF_UNDEFINED)))
27 #define flag_is_global_or_common(x) ((x) & (BSF_GLOBAL | BSF_FORT_COMM))
28 #define flag_is_undefined_or_global_or_common(x) ((x) & (BSF_UNDEFINED | BSF_GLOBAL | BSF_FORT_COMM))
29 #define flag_is_common(x) ((x) & BSF_FORT_COMM)
30 #define flag_is_global(x) ((x) & (BSF_GLOBAL))
31 #define flag_is_undefined(x) ((x) & BSF_UNDEFINED)
32 #define flag_set(x,y) (x = y)
33 #define flag_is_fort_comm(x) ((x) & BSF_FORT_COMM)
34 #define flag_is_absolute(x) ((x) & BSF_ABSOLUTE)
35 /* Extra information we hold on sections */
36 typedef struct  user_section_struct {
37   /* Pointer to the section where this data will go */
38   struct lang_input_statement_struct *file;
39 } section_userdata_type;
40
41
42 #define get_userdata(x) ((x)->userdata)
43 #define as_output_section_statement(x) ((x)->otheruserdata)
44
45 #if 0
46 /*
47  * Structure for communication between do_file_warnings and it's
48  * helper routines.  Will in practice be an array of three of these:
49  * 0) Current line, 1) Next line, 2) Source file info.
50  */
51 struct line_debug_entry
52 {
53   int line;
54   char *filename;
55   struct nlist *sym;
56 };
57
58 #endif
59
60
61 /* Which symbols should be stripped (omitted from the output):
62    none, all, or debugger symbols.  */
63 enum { STRIP_NONE, STRIP_ALL, STRIP_DEBUGGER } strip_symbols;
64
65
66
67
68 /* Which local symbols should be omitted:
69    none, all, or those starting with L.
70    This is irrelevant if STRIP_NONE.  */
71 enum { DISCARD_NONE, DISCARD_ALL, DISCARD_L } discard_locals;
72
73
74
75
76
77
78 #define ALIGN(this, boundary)  ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
79 #if 0
80 #define FOREACHGLOBALSYMBOL(x)   ldsym_type *x; for (x = symbol_head; x; x=x->next)
81
82
83
84
85 #define SECTIONLOOP(abfd, ptr) \
86   asection *ptr; for(ptr = abfd->sections; ptr;ptr=ptr->next)
87
88
89 #endif
90 typedef struct {
91
92   /* 1 => assign space to common symbols even if `relocatable_output'.  */
93   boolean force_common_definition;
94
95 } args_type;
96
97 typedef int token_code_type;
98
99 typedef struct 
100 {
101   unsigned int specified_data_size;
102   boolean magic_demand_paged;
103   boolean make_executable;
104   /* 1 => write relocation into output file so can re-input it later.  */
105   boolean relocateable_output;
106
107   /* Will we build contstructors, or leave alone ? */
108   boolean build_constructors;
109   /* 1 => write relocation such that a UNIX linker can understand it.
110      This is used mainly to finish of sets that were built.  */
111   boolean unix_relocate;
112
113
114 } ld_config_type;
115 #define set_asymbol_chain(x,y) ((x)->udata = (void *)y)
116 #define get_asymbol_chain(x) ((asymbol **)((x)->udata))
117 #define get_loader_symbol(x) ((loader_global_asymbol *)((x)->udata))
118 #define set_loader_symbol(x,y) ((x)->udata = (void *)y)
119
120
121
122
123
124
125 typedef enum {
126   lang_first_phase_enum,
127   lang_allocating_phase_enum,
128   lang_final_phase_enum } lang_phase_type;
129
130
131
132