* objdump.c: Fix formatting.
[deliverable/binutils-gdb.git] / ld / ldexp.h
CommitLineData
252b5132 1/* ldexp.h -
2c382fb6 2 Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
5cc18311 3 Free Software Foundation, Inc.
252b5132
RH
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 2, 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 the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22#ifndef LDEXP_H
23#define LDEXP_H
24
25/* The result of an expression tree */
89cdebba 26typedef struct {
252b5132 27 bfd_vma value;
2c382fb6 28 char *str;
252b5132
RH
29 struct lang_output_section_statement_struct *section;
30 boolean valid_p;
31} etree_value_type;
32
89cdebba 33typedef struct {
252b5132
RH
34 int node_code;
35 enum { etree_binary,
36 etree_trinary,
37 etree_unary,
38 etree_name,
39 etree_assign,
40 etree_provide,
b46a87b1 41 etree_provided,
252b5132
RH
42 etree_undef,
43 etree_unspec,
44 etree_value,
45 etree_assert,
46 etree_rel } node_class;
47} node_type;
48
89cdebba 49typedef union etree_union {
252b5132
RH
50 node_type type;
51 struct {
52 node_type type;
53 union etree_union *lhs;
54 union etree_union *rhs;
55 } binary;
56 struct {
57 node_type type;
58 union etree_union *cond;
59 union etree_union *lhs;
60 union etree_union *rhs;
61 } trinary;
62 struct {
63 node_type type;
2c382fb6 64 const char *dst;
252b5132
RH
65 union etree_union *src;
66 } assign;
252b5132
RH
67 struct {
68 node_type type;
89cdebba 69 union etree_union *child;
252b5132
RH
70 } unary;
71 struct {
72 node_type type;
2c382fb6 73 const char *name;
252b5132
RH
74 } name;
75 struct {
76 node_type type;
77 bfd_vma value;
2c382fb6 78 char *str;
252b5132
RH
79 } value;
80 struct {
81 node_type type;
82 asection *section;
83 bfd_vma value;
84 } rel;
85 struct {
86 node_type type;
87 union etree_union *child;
88 const char *message;
89 } assert_s;
90} etree_type;
2d20f7bf
JJ
91
92extern struct exp_data_seg {
93 enum {
94 exp_dataseg_none,
95 exp_dataseg_align_seen,
96 exp_dataseg_end_seen,
97 exp_dataseg_adjust
98 } phase;
99 bfd_vma base, end, pagesize;
100} exp_data_seg;
252b5132 101
2c382fb6
AM
102typedef struct _fill_type fill_type;
103
252b5132 104etree_type *exp_intop PARAMS ((bfd_vma));
2c382fb6 105etree_type *exp_bigintop PARAMS ((bfd_vma, char *));
252b5132
RH
106etree_type *exp_relop PARAMS ((asection *, bfd_vma));
107etree_value_type invalid PARAMS ((void));
108etree_value_type exp_fold_tree PARAMS ((etree_type *, struct
109 lang_output_section_statement_struct *,
110 lang_phase_type,
111 bfd_vma, bfd_vma *));
112etree_type *exp_binop PARAMS ((int, etree_type *, etree_type *));
113etree_type *exp_trinop PARAMS ((int,etree_type *, etree_type *, etree_type *));
114etree_type *exp_unop PARAMS ((int, etree_type *));
2c382fb6
AM
115etree_type *exp_nameop PARAMS ((int, const char *));
116etree_type *exp_assop PARAMS ((int, const char *, etree_type *));
252b5132
RH
117etree_type *exp_provide PARAMS ((const char *, etree_type *));
118etree_type *exp_assert PARAMS ((etree_type *, const char *));
119void exp_print_tree PARAMS ((etree_type *));
120bfd_vma exp_get_vma PARAMS ((etree_type *, bfd_vma, char *, lang_phase_type));
89cdebba 121int exp_get_value_int PARAMS ((etree_type *, int, char *, lang_phase_type));
2c382fb6
AM
122fill_type *exp_get_fill PARAMS ((etree_type *, fill_type *, char *,
123 lang_phase_type));
89cdebba 124bfd_vma exp_get_abs_int PARAMS ((etree_type *, int, char *, lang_phase_type));
252b5132
RH
125
126#endif
This page took 0.1177 seconds and 4 git commands to generate.