OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [ld/] [ldexp.h] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
/* ldexp.h -
/* ldexp.h -
   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
   Copyright 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002,
   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
 
 
   This file is part of the GNU Binutils.
   This file is part of the GNU Binutils.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */
   MA 02110-1301, USA.  */
 
 
#ifndef LDEXP_H
#ifndef LDEXP_H
#define LDEXP_H
#define LDEXP_H
 
 
/* The result of an expression tree */
/* The result of an expression tree */
typedef struct {
typedef struct {
  bfd_vma value;
  bfd_vma value;
  char *str;
  char *str;
  asection *section;
  asection *section;
  bfd_boolean valid_p;
  bfd_boolean valid_p;
} etree_value_type;
} etree_value_type;
 
 
typedef struct {
typedef struct {
  int node_code;
  int node_code;
  unsigned int lineno;
  unsigned int lineno;
  enum {
  enum {
    etree_binary,
    etree_binary,
    etree_trinary,
    etree_trinary,
    etree_unary,
    etree_unary,
    etree_name,
    etree_name,
    etree_assign,
    etree_assign,
    etree_provide,
    etree_provide,
    etree_provided,
    etree_provided,
    etree_value,
    etree_value,
    etree_assert,
    etree_assert,
    etree_rel
    etree_rel
  } node_class;
  } node_class;
} node_type;
} node_type;
 
 
typedef union etree_union {
typedef union etree_union {
  node_type type;
  node_type type;
  struct {
  struct {
    node_type type;
    node_type type;
    union etree_union *lhs;
    union etree_union *lhs;
    union etree_union *rhs;
    union etree_union *rhs;
  } binary;
  } binary;
  struct {
  struct {
    node_type type;
    node_type type;
    union etree_union *cond;
    union etree_union *cond;
    union etree_union *lhs;
    union etree_union *lhs;
    union etree_union *rhs;
    union etree_union *rhs;
  } trinary;
  } trinary;
  struct {
  struct {
    node_type type;
    node_type type;
    const char *dst;
    const char *dst;
    union etree_union *src;
    union etree_union *src;
    bfd_boolean hidden;
    bfd_boolean hidden;
  } assign;
  } assign;
  struct {
  struct {
    node_type type;
    node_type type;
    union etree_union *child;
    union etree_union *child;
  } unary;
  } unary;
  struct {
  struct {
    node_type type;
    node_type type;
    const char *name;
    const char *name;
  } name;
  } name;
  struct {
  struct {
    node_type type;
    node_type type;
    bfd_vma value;
    bfd_vma value;
    char *str;
    char *str;
  } value;
  } value;
  struct {
  struct {
    node_type type;
    node_type type;
    asection *section;
    asection *section;
    bfd_vma value;
    bfd_vma value;
  } rel;
  } rel;
  struct {
  struct {
    node_type type;
    node_type type;
    union etree_union *child;
    union etree_union *child;
    const char *message;
    const char *message;
  } assert_s;
  } assert_s;
} etree_type;
} etree_type;
 
 
typedef enum {
typedef enum {
  lang_first_phase_enum,
  lang_first_phase_enum,
  lang_mark_phase_enum,
  lang_mark_phase_enum,
  lang_allocating_phase_enum,
  lang_allocating_phase_enum,
  lang_final_phase_enum
  lang_final_phase_enum
} lang_phase_type;
} lang_phase_type;
 
 
union lang_statement_union;
union lang_statement_union;
 
 
struct ldexp_control {
struct ldexp_control {
  /* Modify expression evaluation depending on this.  */
  /* Modify expression evaluation depending on this.  */
  lang_phase_type phase;
  lang_phase_type phase;
 
 
  /* Principally used for diagnostics.  */
  /* Principally used for diagnostics.  */
  bfd_boolean assigning_to_dot;
  bfd_boolean assigning_to_dot;
 
 
  /* Working results.  */
  /* Working results.  */
  etree_value_type result;
  etree_value_type result;
  bfd_vma dot;
  bfd_vma dot;
 
 
  /* Current dot and section passed to ldexp folder.  */
  /* Current dot and section passed to ldexp folder.  */
  bfd_vma *dotp;
  bfd_vma *dotp;
  asection *section;
  asection *section;
 
 
  /* State machine and results for DATASEG.  */
  /* State machine and results for DATASEG.  */
  struct {
  struct {
    enum {
    enum {
      exp_dataseg_none,
      exp_dataseg_none,
      exp_dataseg_align_seen,
      exp_dataseg_align_seen,
      exp_dataseg_relro_seen,
      exp_dataseg_relro_seen,
      exp_dataseg_end_seen,
      exp_dataseg_end_seen,
      exp_dataseg_relro_adjust,
      exp_dataseg_relro_adjust,
      exp_dataseg_adjust
      exp_dataseg_adjust
    } phase;
    } phase;
 
 
    bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize;
    bfd_vma base, min_base, relro_end, end, pagesize, maxpagesize;
 
 
    enum {
    enum {
      exp_dataseg_relro_none,
      exp_dataseg_relro_none,
      exp_dataseg_relro_start,
      exp_dataseg_relro_start,
      exp_dataseg_relro_end,
      exp_dataseg_relro_end,
    } relro;
    } relro;
 
 
    union lang_statement_union *relro_start_stat;
    union lang_statement_union *relro_start_stat;
    union lang_statement_union *relro_end_stat;
    union lang_statement_union *relro_end_stat;
  } dataseg;
  } dataseg;
};
};
 
 
extern struct ldexp_control expld;
extern struct ldexp_control expld;
 
 
/* A maps from a segment name to a base address.  */
/* A maps from a segment name to a base address.  */
typedef struct segment_struct {
typedef struct segment_struct {
  /* The next segment in the linked list.  */
  /* The next segment in the linked list.  */
  struct segment_struct *next;
  struct segment_struct *next;
  /* The name of the sgement.  */
  /* The name of the sgement.  */
  const char *name;
  const char *name;
  /* The base address for the segment.  */
  /* The base address for the segment.  */
  bfd_vma value;
  bfd_vma value;
  /* True if a SEGMENT_START directive corresponding to this segment
  /* True if a SEGMENT_START directive corresponding to this segment
     has been seen.  */
     has been seen.  */
  bfd_boolean used;
  bfd_boolean used;
} segment_type;
} segment_type;
 
 
/* The segments specified by the user on the command-line.  */
/* The segments specified by the user on the command-line.  */
extern segment_type *segments;
extern segment_type *segments;
 
 
typedef struct _fill_type fill_type;
typedef struct _fill_type fill_type;
 
 
etree_type *exp_intop
etree_type *exp_intop
  (bfd_vma);
  (bfd_vma);
etree_type *exp_bigintop
etree_type *exp_bigintop
  (bfd_vma, char *);
  (bfd_vma, char *);
etree_type *exp_relop
etree_type *exp_relop
  (asection *, bfd_vma);
  (asection *, bfd_vma);
void exp_fold_tree
void exp_fold_tree
  (etree_type *, asection *, bfd_vma *);
  (etree_type *, asection *, bfd_vma *);
etree_type *exp_binop
etree_type *exp_binop
  (int, etree_type *, etree_type *);
  (int, etree_type *, etree_type *);
etree_type *exp_trinop
etree_type *exp_trinop
  (int,etree_type *, etree_type *, etree_type *);
  (int,etree_type *, etree_type *, etree_type *);
etree_type *exp_unop
etree_type *exp_unop
  (int, etree_type *);
  (int, etree_type *);
etree_type *exp_nameop
etree_type *exp_nameop
  (int, const char *);
  (int, const char *);
etree_type *exp_assop
etree_type *exp_assop
  (int, const char *, etree_type *);
  (int, const char *, etree_type *);
etree_type *exp_provide
etree_type *exp_provide
  (const char *, etree_type *, bfd_boolean);
  (const char *, etree_type *, bfd_boolean);
etree_type *exp_assert
etree_type *exp_assert
  (etree_type *, const char *);
  (etree_type *, const char *);
void exp_print_tree
void exp_print_tree
  (etree_type *);
  (etree_type *);
bfd_vma exp_get_vma
bfd_vma exp_get_vma
  (etree_type *, bfd_vma, char *);
  (etree_type *, bfd_vma, char *);
int exp_get_value_int
int exp_get_value_int
  (etree_type *, int, char *);
  (etree_type *, int, char *);
fill_type *exp_get_fill
fill_type *exp_get_fill
  (etree_type *, fill_type *, char *);
  (etree_type *, fill_type *, char *);
bfd_vma exp_get_abs_int
bfd_vma exp_get_abs_int
  (etree_type *, int, char *);
  (etree_type *, int, char *);
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.