o Use new `!<field>' and `=<field>' operators in spec of
[deliverable/binutils-gdb.git] / ld / ld.h
CommitLineData
2ed9fe47
ILT
1/* ld.h -- general linker header file
2 Copyright (C) 1991, 93, 94, 95, 1996 Free Software Foundation, Inc.
2fa0b342
DHW
3
4 This file is part of GLD, the Gnu Linker.
5
6 GLD is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
c1074477 8 the Free Software Foundation; either version 2, or (at your option)
2fa0b342
DHW
9 any later version.
10
11 GLD is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
2ed9fe47
ILT
17 along with GLD; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19 02111-1307, USA. */
2fa0b342 20
2a9fa50c
ILT
21#ifndef LD_H
22#define LD_H
2fa0b342 23
6799c638
ILT
24/* Look in this environment name for the linker to pretend to be */
25#define EMULATION_ENVIRON "LDEMULATION"
26/* If in there look for the strings: */
27
28/* Look in this variable for a target format */
29#define TARGET_ENVIRON "GNUTARGET"
30
31/* Input sections which are put in a section of this name are actually
32 discarded. */
33#define DISCARD_SECTION_NAME "/DISCARD/"
34
2fa0b342 35/* Extra information we hold on sections */
2a9fa50c
ILT
36typedef struct user_section_struct
37{
2fa0b342
DHW
38 /* Pointer to the section where this data will go */
39 struct lang_input_statement_struct *file;
40} section_userdata_type;
41
42
43#define get_userdata(x) ((x)->userdata)
2fa0b342 44
c1074477
DE
45#define BYTE_SIZE (1)
46#define SHORT_SIZE (2)
47#define LONG_SIZE (4)
2a9fa50c 48#define QUAD_SIZE (8)
2fa0b342 49
c1074477
DE
50/* ALIGN macro changed to ALIGN_N to avoid */
51/* conflict in /usr/include/machine/machparam.h */
2a9fa50c 52/* WARNING: If THIS is a 64 bit address and BOUNDARY is a 32 bit int,
73f5d5fe
DE
53 you must coerce boundary to the same type as THIS.
54 ??? Is there a portable way to avoid this. */
2a9fa50c
ILT
55#define ALIGN_N(this, boundary) \
56 ((( (this) + ((boundary) -1)) & (~((boundary)-1))))
2fa0b342 57
2a9fa50c
ILT
58typedef struct
59{
2fa0b342
DHW
60 /* 1 => assign space to common symbols even if `relocatable_output'. */
61 boolean force_common_definition;
c1074477 62 boolean relax;
809ee7e0
ILT
63
64 /* Name of runtime interpreter to invoke. */
65 char *interpreter;
66
67 /* Name to give runtime libary from the -soname argument. */
68 char *soname;
69
70 /* Runtime library search path from the -rpath argument. */
71 char *rpath;
943fbd5b 72
6799c638
ILT
73 /* Link time runtime library search path from the -rpath-link
74 argument. */
75 char *rpath_link;
76
943fbd5b
KR
77 /* Big or little endian as set on command line. */
78 enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
79
80 /* If true, export all symbols in the dynamic symbol table of an ELF
81 executable. */
82 boolean export_dynamic;
83
84 /* If true, build MIPS embedded PIC relocation tables in the output
85 file. */
86 boolean embedded_relocs;
cd09553a
ILT
87
88 /* If true, force generation of a file with a .exe file. */
89 boolean force_exe_suffix;
90
91 /* If true, generate a cross reference report. */
92 boolean cref;
2fa0b342
DHW
93} args_type;
94
2a9fa50c
ILT
95extern args_type command_line;
96
2fa0b342
DHW
97typedef int token_code_type;
98
99typedef struct
100{
c1074477 101 bfd_size_type specified_data_size;
2fa0b342
DHW
102 boolean magic_demand_paged;
103 boolean make_executable;
2fa0b342 104
2a9fa50c
ILT
105 /* If true, doing a dynamic link. */
106 boolean dynamic_link;
107
6799c638 108 /* If true, build constructors. */
2fa0b342 109 boolean build_constructors;
c1074477 110
6799c638
ILT
111 /* If true, warn about any constructors. */
112 boolean warn_constructors;
113
c1074477
DE
114 /* If true, warn about merging common symbols with others. */
115 boolean warn_common;
2fa0b342 116
809ee7e0
ILT
117 /* If true, only warn once about a particular undefined symbol. */
118 boolean warn_once;
119
6799c638
ILT
120 /* If true, warn if multiple global-pointers are needed (Alpha
121 only). */
122 boolean warn_multiple_gp;
123
b6316534 124 boolean sort_common;
2a9fa50c 125
c1074477
DE
126 boolean text_read_only;
127
2a9fa50c
ILT
128 char *map_filename;
129 FILE *map_file;
c1074477 130
2a9fa50c 131 boolean stats;
943fbd5b
KR
132
133 int split_by_reloc;
134 boolean split_by_file;
2fa0b342 135} ld_config_type;
2fa0b342 136
2a9fa50c 137extern ld_config_type config;
2fa0b342 138
2a9fa50c
ILT
139typedef enum
140{
2fa0b342
DHW
141 lang_first_phase_enum,
142 lang_allocating_phase_enum,
2a9fa50c
ILT
143 lang_final_phase_enum
144} lang_phase_type;
2fa0b342 145
2a9fa50c
ILT
146extern boolean had_script;
147extern boolean force_make_executable;
2fa0b342 148
6799c638
ILT
149/* Non-zero if we are processing a --defsym from the command line. */
150extern int parsing_defsym;
151
2a9fa50c 152extern int yyparse PARAMS ((void));
c1074477 153
cd09553a
ILT
154extern void add_cref PARAMS ((const char *, bfd *, asection *, bfd_vma));
155extern void output_cref PARAMS ((FILE *));
156
2a9fa50c 157#endif
This page took 0.232124 seconds and 4 git commands to generate.