Back to index

cell-binutils  2.17cvs20070401
Classes | Typedefs | Enumerations | Functions | Variables
ldexp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  etree_value_type
struct  node_type
union  etree_union
struct  ldexp_control
struct  segment_struct
struct  etree_union.binary
struct  etree_union.trinary
struct  etree_union.assign
struct  etree_union.unary
struct  etree_union.name
struct  etree_union.value
struct  etree_union.rel
struct  etree_union.assert_s
struct  ldexp_control.dataseg

Typedefs

typedef union etree_union etree_type
typedef struct segment_struct segment_type
typedef struct _fill_type

Enumerations

enum  lang_phase_type { lang_first_phase_enum, lang_mark_phase_enum, lang_allocating_phase_enum, lang_final_phase_enum }

Functions

etree_typeexp_intop (bfd_vma)
etree_typeexp_bigintop (bfd_vma, char *)
etree_typeexp_relop (asection *, bfd_vma)
void exp_fold_tree (etree_type *, asection *, bfd_vma *)
etree_typeexp_binop (int, etree_type *, etree_type *)
etree_typeexp_trinop (int, etree_type *, etree_type *, etree_type *)
etree_typeexp_unop (int, etree_type *)
etree_typeexp_nameop (int, const char *)
etree_typeexp_assop (int, const char *, etree_type *)
etree_typeexp_provide (const char *, etree_type *, bfd_boolean)
etree_typeexp_assert (etree_type *, const char *)
void exp_print_tree (etree_type *)
bfd_vma exp_get_vma (etree_type *, bfd_vma, char *)
int exp_get_value_int (etree_type *, int, char *)
fill_type * exp_get_fill (etree_type *, fill_type *, char *)
bfd_vma exp_get_abs_int (etree_type *, int, char *)

Variables

segment_typesegments

Class Documentation

struct etree_value_type

Definition at line 26 of file ldexp.h.

Collaboration diagram for etree_value_type:
Class Members
asection * section
char * str
bfd_boolean valid_p
bfd_vma value
union etree_union

Definition at line 49 of file ldexp.h.

Collaboration diagram for etree_union:
Class Members
struct etree_union assert_s
struct etree_union assign
struct etree_union binary
struct etree_union name
struct etree_union rel
struct etree_union trinary
node_type type
struct etree_union unary
struct etree_union value
struct ldexp_control

Definition at line 100 of file ldexp.h.

Collaboration diagram for ldexp_control:
Class Members
bfd_boolean assigning_to_dot
struct ldexp_control dataseg
bfd_vma dot
bfd_vma * dotp
lang_phase_type phase
etree_value_type result
asection * section
struct segment_struct

Definition at line 133 of file ldexp.h.

Collaboration diagram for segment_struct:
Class Members
const char * name
struct segment_struct * next
bfd_boolean used
bfd_vma value
struct etree_union.binary

Definition at line 51 of file ldexp.h.

Class Members
union etree_union * lhs
union etree_union * rhs
node_type type
struct etree_union.trinary

Definition at line 56 of file ldexp.h.

Class Members
union etree_union * cond
union etree_union * lhs
union etree_union * rhs
node_type type
struct etree_union.assign

Definition at line 62 of file ldexp.h.

Class Members
const char * dst
bfd_boolean hidden
union etree_union * src
node_type type
struct etree_union.unary

Definition at line 68 of file ldexp.h.

Class Members
union etree_union * child
node_type type
struct etree_union.name

Definition at line 72 of file ldexp.h.

Class Members
const char * name
node_type type
struct etree_union.value

Definition at line 76 of file ldexp.h.

Class Members
char * str
node_type type
bfd_vma value
struct etree_union.rel

Definition at line 81 of file ldexp.h.

Class Members
asection * section
node_type type
bfd_vma value
struct etree_union.assert_s

Definition at line 86 of file ldexp.h.

Class Members
union etree_union * child
const char * message
node_type type
struct ldexp_control.dataseg

Definition at line 116 of file ldexp.h.

Class Members
bfd_vma base
bfd_vma end
bfd_vma maxpagesize
bfd_vma min_base
bfd_vma pagesize
enum ldexp_control phase
bfd_vma relro_end

Typedef Documentation

typedef struct _fill_type

Definition at line 148 of file ldexp.h.

typedef union etree_union etree_type

Enumeration Type Documentation

Enumerator:
lang_first_phase_enum 
lang_mark_phase_enum 
lang_allocating_phase_enum 
lang_final_phase_enum 

Definition at line 93 of file ldexp.h.


Function Documentation

etree_type* exp_assert ( etree_type ,
const char *   
)

Definition at line 931 of file ldexp.c.

{
  etree_type *n;

  n = stat_alloc (sizeof (n->assert_s));
  n->assert_s.type.node_code = '!';
  n->assert_s.type.node_class = etree_assert;
  n->assert_s.child = exp;
  n->assert_s.message = message;
  return n;
}

Here is the call graph for this function:

etree_type* exp_assop ( int  ,
const char *  ,
etree_type  
)

Definition at line 900 of file ldexp.c.

{
  etree_type *new;

  new = stat_alloc (sizeof (new->assign));
  new->type.node_code = code;
  new->type.node_class = etree_assign;
  new->assign.src = src;
  new->assign.dst = dst;
  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

etree_type* exp_bigintop ( bfd_vma  ,
char *   
)

Definition at line 160 of file ldexp.c.

{
  etree_type *new = stat_alloc (sizeof (new->value));
  new->type.node_code = INT;
  new->value.value = value;
  new->value.str = str;
  new->type.node_class = etree_value;
  return new;
}

Here is the call graph for this function:

etree_type* exp_binop ( int  ,
etree_type ,
etree_type  
)

Definition at line 827 of file ldexp.c.

{
  etree_type value, *new;

  value.type.node_code = code;
  value.binary.lhs = lhs;
  value.binary.rhs = rhs;
  value.type.node_class = etree_binary;
  exp_fold_tree_no_dot (&value);
  if (expld.result.valid_p)
    return exp_intop (expld.result.value);

  new = stat_alloc (sizeof (new->binary));
  memcpy (new, &value, sizeof (new->binary));
  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void exp_fold_tree ( etree_type ,
asection ,
bfd_vma  
)

Definition at line 809 of file ldexp.c.

{
  expld.dot = *dotp;
  expld.dotp = dotp;
  expld.section = current_section;
  exp_fold_tree_1 (tree);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma exp_get_abs_int ( etree_type ,
int  ,
char *   
)

Definition at line 1103 of file ldexp.c.

{
  if (tree != NULL)
    {
      exp_fold_tree_no_dot (tree);

      if (expld.result.valid_p)
       {
         expld.result.value += expld.result.section->vma;
         return expld.result.value;
       }
      else if (name != NULL && expld.phase != lang_mark_phase_enum)
       einfo (_("%F%S nonconstant expression for %s\n"), name);
    }
  return def;
}

Here is the call graph for this function:

Here is the caller graph for this function:

fill_type* exp_get_fill ( etree_type ,
fill_type *  ,
char *   
)

Definition at line 1045 of file ldexp.c.

{
  fill_type *fill;
  size_t len;
  unsigned int val;

  if (tree == NULL)
    return def;

  exp_fold_tree_no_dot (tree);
  if (!expld.result.valid_p)
    {
      if (name != NULL && expld.phase != lang_mark_phase_enum)
       einfo (_("%F%S nonconstant expression for %s\n"), name);
      return def;
    }

  if (expld.result.str != NULL && (len = strlen (expld.result.str)) != 0)
    {
      unsigned char *dst;
      unsigned char *s;
      fill = xmalloc ((len + 1) / 2 + sizeof (*fill) - 1);
      fill->size = (len + 1) / 2;
      dst = fill->data;
      s = (unsigned char *) expld.result.str;
      val = 0;
      do
       {
         unsigned int digit;

         digit = *s++ - '0';
         if (digit > 9)
           digit = (digit - 'A' + '0' + 10) & 0xf;
         val <<= 4;
         val += digit;
         --len;
         if ((len & 1) == 0)
           {
             *dst++ = val;
             val = 0;
           }
       }
      while (len != 0);
    }
  else
    {
      fill = xmalloc (4 + sizeof (*fill) - 1);
      val = expld.result.value;
      fill->data[0] = (val >> 24) & 0xff;
      fill->data[1] = (val >> 16) & 0xff;
      fill->data[2] = (val >>  8) & 0xff;
      fill->data[3] = (val >>  0) & 0xff;
      fill->size = 4;
    }
  return fill;
}

Here is the call graph for this function:

int exp_get_value_int ( etree_type ,
int  ,
char *   
)

Definition at line 1039 of file ldexp.c.

{
  return exp_get_vma (tree, def, name);
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_vma exp_get_vma ( etree_type ,
bfd_vma  ,
char *   
)

Definition at line 1025 of file ldexp.c.

{
  if (tree != NULL)
    {
      exp_fold_tree_no_dot (tree);
      if (expld.result.valid_p)
       return expld.result.value;
      else if (name != NULL && expld.phase != lang_mark_phase_enum)
       einfo (_("%F%S nonconstant expression for %s\n"), name);
    }
  return def;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 149 of file ldexp.c.

{
  etree_type *new = stat_alloc (sizeof (new->value));
  new->type.node_code = INT;
  new->value.value = value;
  new->value.str = NULL;
  new->type.node_class = etree_value;
  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

etree_type* exp_nameop ( int  ,
const char *   
)

Definition at line 881 of file ldexp.c.

{
  etree_type value, *new;

  value.name.type.node_code = code;
  value.name.name = name;
  value.name.type.node_class = etree_name;

  exp_fold_tree_no_dot (&value);
  if (expld.result.valid_p)
    return exp_intop (expld.result.value);

  new = stat_alloc (sizeof (new->name));
  memcpy (new, &value, sizeof (new->name));
  return new;

}

Here is the call graph for this function:

Here is the caller graph for this function:

void exp_print_tree ( etree_type )

Definition at line 944 of file ldexp.c.

{
  if (config.map_file == NULL)
    config.map_file = stderr;

  if (tree == NULL)
    {
      minfo ("NULL TREE\n");
      return;
    }

  switch (tree->type.node_class)
    {
    case etree_value:
      minfo ("0x%v", tree->value.value);
      return;
    case etree_rel:
      if (tree->rel.section->owner != NULL)
       minfo ("%B:", tree->rel.section->owner);
      minfo ("%s+0x%v", tree->rel.section->name, tree->rel.value);
      return;
    case etree_assign:
      fprintf (config.map_file, "%s", tree->assign.dst);
      exp_print_token (tree->type.node_code, TRUE);
      exp_print_tree (tree->assign.src);
      break;
    case etree_provide:
    case etree_provided:
      fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst);
      exp_print_tree (tree->assign.src);
      fprintf (config.map_file, ")");
      break;
    case etree_binary:
      fprintf (config.map_file, "(");
      exp_print_tree (tree->binary.lhs);
      exp_print_token (tree->type.node_code, TRUE);
      exp_print_tree (tree->binary.rhs);
      fprintf (config.map_file, ")");
      break;
    case etree_trinary:
      exp_print_tree (tree->trinary.cond);
      fprintf (config.map_file, "?");
      exp_print_tree (tree->trinary.lhs);
      fprintf (config.map_file, ":");
      exp_print_tree (tree->trinary.rhs);
      break;
    case etree_unary:
      exp_print_token (tree->unary.type.node_code, FALSE);
      if (tree->unary.child)
       {
         fprintf (config.map_file, " (");
         exp_print_tree (tree->unary.child);
         fprintf (config.map_file, ")");
       }
      break;

    case etree_assert:
      fprintf (config.map_file, "ASSERT (");
      exp_print_tree (tree->assert_s.child);
      fprintf (config.map_file, ", %s)", tree->assert_s.message);
      break;

    case etree_name:
      if (tree->type.node_code == NAME)
       {
         fprintf (config.map_file, "%s", tree->name.name);
       }
      else
       {
         exp_print_token (tree->type.node_code, FALSE);
         if (tree->name.name)
           fprintf (config.map_file, " (%s)", tree->name.name);
       }
      break;
    default:
      FAIL ();
      break;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

etree_type* exp_provide ( const char *  ,
etree_type ,
bfd_boolean   
)

Definition at line 915 of file ldexp.c.

{
  etree_type *n;

  n = stat_alloc (sizeof (n->assign));
  n->assign.type.node_code = '=';
  n->assign.type.node_class = etree_provide;
  n->assign.src = src;
  n->assign.dst = dst;
  n->assign.hidden = hidden;
  return n;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file ldexp.c.

{
  etree_type *new = stat_alloc (sizeof (new->rel));
  new->type.node_code = REL;
  new->type.node_class = etree_rel;
  new->rel.section = section;
  new->rel.value = value;
  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 845 of file ldexp.c.

{
  etree_type value, *new;

  value.type.node_code = code;
  value.trinary.lhs = lhs;
  value.trinary.cond = cond;
  value.trinary.rhs = rhs;
  value.type.node_class = etree_trinary;
  exp_fold_tree_no_dot (&value);
  if (expld.result.valid_p)
    return exp_intop (expld.result.value);

  new = stat_alloc (sizeof (new->trinary));
  memcpy (new, &value, sizeof (new->trinary));
  return new;
}

Here is the call graph for this function:

etree_type* exp_unop ( int  ,
etree_type  
)

Definition at line 864 of file ldexp.c.

{
  etree_type value, *new;

  value.unary.type.node_code = code;
  value.unary.child = child;
  value.unary.type.node_class = etree_unary;
  exp_fold_tree_no_dot (&value);
  if (expld.result.valid_p)
    return exp_intop (expld.result.value);

  new = stat_alloc (sizeof (new->unary));
  memcpy (new, &value, sizeof (new->unary));
  return new;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 48 of file ldexp.c.