2 Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
3 2003, 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GLD, the Gnu Linker.
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 2, or (at your option)
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.
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 the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
25 /* The result of an expression tree */
49 typedef union etree_union
{
53 union etree_union
*lhs
;
54 union etree_union
*rhs
;
58 union etree_union
*cond
;
59 union etree_union
*lhs
;
60 union etree_union
*rhs
;
65 union etree_union
*src
;
70 union etree_union
*child
;
88 union etree_union
*child
;
94 lang_first_phase_enum
,
96 lang_allocating_phase_enum
,
100 struct ldexp_control
{
101 /* Modify expression evaluation depending on this. */
102 lang_phase_type phase
;
104 /* Principally used for diagnostics. */
105 bfd_boolean assigning_to_dot
;
107 /* Working results. */
108 etree_value_type result
;
111 /* Current dot and section passed to ldexp folder. */
115 /* State machine and results for DATASEG. */
119 exp_dataseg_align_seen
,
120 exp_dataseg_relro_seen
,
121 exp_dataseg_end_seen
,
122 exp_dataseg_relro_adjust
,
126 bfd_vma base
, min_base
, relro_end
, end
, pagesize
, maxpagesize
;
130 extern struct ldexp_control expld
;
132 /* A maps from a segment name to a base address. */
133 typedef struct segment_struct
{
134 /* The next segment in the linked list. */
135 struct segment_struct
*next
;
136 /* The name of the sgement. */
138 /* The base address for the segment. */
140 /* True if a SEGMENT_START directive corresponding to this segment
145 /* The segments specified by the user on the command-line. */
146 extern segment_type
*segments
;
148 typedef struct _fill_type fill_type
;
150 etree_type
*exp_intop
152 etree_type
*exp_bigintop
154 etree_type
*exp_relop
155 (asection
*, bfd_vma
);
157 (etree_type
*, asection
*, bfd_vma
*);
158 etree_type
*exp_binop
159 (int, etree_type
*, etree_type
*);
160 etree_type
*exp_trinop
161 (int,etree_type
*, etree_type
*, etree_type
*);
164 etree_type
*exp_nameop
166 etree_type
*exp_assop
167 (int, const char *, etree_type
*);
168 etree_type
*exp_provide
169 (const char *, etree_type
*, bfd_boolean
);
170 etree_type
*exp_assert
171 (etree_type
*, const char *);
175 (etree_type
*, bfd_vma
, char *);
176 int exp_get_value_int
177 (etree_type
*, int, char *);
178 fill_type
*exp_get_fill
179 (etree_type
*, fill_type
*, char *);
180 bfd_vma exp_get_abs_int
181 (etree_type
*, int, char *);