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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [binutils-2.20.1/] [binutils-2.20.1-or32-1.0rc1/] [gold/] [defstd.cc] - Diff between revs 205 and 521

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

Rev 205 Rev 521
// defstd.cc -- define standard symbols for gold.
// defstd.cc -- define standard symbols for gold.
 
 
// Copyright 2006, 2007 Free Software Foundation, Inc.
// Copyright 2006, 2007 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// Written by Ian Lance Taylor <iant@google.com>.
 
 
// This file is part of gold.
// This file is part of gold.
 
 
// 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.
 
 
#include "gold.h"
#include "gold.h"
 
 
#include "symtab.h"
#include "symtab.h"
#include "layout.h"
#include "layout.h"
#include "defstd.h"
#include "defstd.h"
 
 
// This is a simple file which defines the standard symbols like
// This is a simple file which defines the standard symbols like
// "_end".
// "_end".
 
 
namespace
namespace
{
{
 
 
using namespace gold;
using namespace gold;
 
 
const Define_symbol_in_section in_section[] =
const Define_symbol_in_section in_section[] =
{
{
  {
  {
    "__preinit_array_start",    // name
    "__preinit_array_start",    // name
    ".preinit_array",           // output_section
    ".preinit_array",           // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__preinit_array_end",      // name
    "__preinit_array_end",      // name
    ".preinit_array",           // output_section
    ".preinit_array",           // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    true,                       // offset_is_from_end
    true,                       // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__init_array_start",       // name
    "__init_array_start",       // name
    ".init_array",              // output_section
    ".init_array",              // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__init_array_end",         // name
    "__init_array_end",         // name
    ".init_array",              // output_section
    ".init_array",              // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    true,                       // offset_is_from_end
    true,                       // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__fini_array_start",       // name
    "__fini_array_start",       // name
    ".fini_array",              // output_section
    ".fini_array",              // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__fini_array_end",         // name
    "__fini_array_end",         // name
    ".fini_array",              // output_section
    ".fini_array",              // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    true,                       // offset_is_from_end
    true,                       // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__rel_iplt_start",         // name
    "__rel_iplt_start",         // name
    ".rel.iplt",                // output_section
    ".rel.iplt",                // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__rel_iplt_end",           // name
    "__rel_iplt_end",           // name
    ".rel.iplt",                // output_section
    ".rel.iplt",                // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    true,                       // offset_is_from_end
    true,                       // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__rela_iplt_start",        // name
    "__rela_iplt_start",        // name
    ".rela.iplt",               // output_section
    ".rela.iplt",               // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__rela_iplt_end",          // name
    "__rela_iplt_end",          // name
    ".rela.iplt",               // output_section
    ".rela.iplt",               // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_HIDDEN,         // visibility
    elfcpp::STV_HIDDEN,         // visibility
    0,                           // nonvis
    0,                           // nonvis
    true,                       // offset_is_from_end
    true,                       // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__stack",                  // name
    "__stack",                  // name
    ".stack",                   // output_section
    ".stack",                   // output_section
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    false,                      // offset_is_from_end
    false,                      // offset_is_from_end
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
};
};
 
 
const int in_section_count = sizeof in_section / sizeof in_section[0];
const int in_section_count = sizeof in_section / sizeof in_section[0];
 
 
const Define_symbol_in_segment in_segment[] =
const Define_symbol_in_segment in_segment[] =
{
{
  {
  {
    "__executable_start",       // name
    "__executable_start",       // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF(0),               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_START,      // offset_from_base
    Symbol::SEGMENT_START,      // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "etext",                    // name
    "etext",                    // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_clear
    elfcpp::PF_W,               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_END,        // offset_from_base
    Symbol::SEGMENT_END,        // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "_etext",                   // name
    "_etext",                   // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_clear
    elfcpp::PF_W,               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_END,        // offset_from_base
    Symbol::SEGMENT_END,        // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__etext",                  // name
    "__etext",                  // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_X,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_clear
    elfcpp::PF_W,               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_END,        // offset_from_base
    Symbol::SEGMENT_END,        // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "_edata",                   // name
    "_edata",                   // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_BSS,        // offset_from_base
    Symbol::SEGMENT_BSS,        // offset_from_base
    false                       // only_if_ref
    false                       // only_if_ref
  },
  },
  {
  {
    "edata",                    // name
    "edata",                    // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_BSS,        // offset_from_base
    Symbol::SEGMENT_BSS,        // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  },
  },
  {
  {
    "__bss_start",              // name
    "__bss_start",              // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_BSS,        // offset_from_base
    Symbol::SEGMENT_BSS,        // offset_from_base
    false                       // only_if_ref
    false                       // only_if_ref
  },
  },
  {
  {
    "_end",                     // name
    "_end",                     // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_END,        // offset_from_base
    Symbol::SEGMENT_END,        // offset_from_base
    false                       // only_if_ref
    false                       // only_if_ref
  },
  },
  {
  {
    "end",                      // name
    "end",                      // name
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PT_LOAD,            // segment_type
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF_W,               // segment_flags_set
    elfcpp::PF(0),               // segment_flags_clear
    elfcpp::PF(0),               // segment_flags_clear
    0,                           // value
    0,                           // value
    0,                           // size
    0,                           // size
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STT_NOTYPE,         // type
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STB_GLOBAL,         // binding
    elfcpp::STV_DEFAULT,        // visibility
    elfcpp::STV_DEFAULT,        // visibility
    0,                           // nonvis
    0,                           // nonvis
    Symbol::SEGMENT_END,        // offset_from_base
    Symbol::SEGMENT_END,        // offset_from_base
    true                        // only_if_ref
    true                        // only_if_ref
  }
  }
};
};
 
 
const int in_segment_count = sizeof in_segment / sizeof in_segment[0];
const int in_segment_count = sizeof in_segment / sizeof in_segment[0];
 
 
} // End anonymous namespace.
} // End anonymous namespace.
 
 
namespace gold
namespace gold
{
{
 
 
void
void
define_standard_symbols(Symbol_table* symtab, const Layout* layout)
define_standard_symbols(Symbol_table* symtab, const Layout* layout)
{
{
  bool saw_sections_clause = layout->script_options()->saw_sections_clause();
  bool saw_sections_clause = layout->script_options()->saw_sections_clause();
  symtab->define_symbols(layout, in_section_count, in_section,
  symtab->define_symbols(layout, in_section_count, in_section,
                         saw_sections_clause);
                         saw_sections_clause);
  symtab->define_symbols(layout, in_segment_count, in_segment,
  symtab->define_symbols(layout, in_segment_count, in_segment,
                         saw_sections_clause);
                         saw_sections_clause);
}
}
 
 
} // End namespace gold.
} // End namespace gold.
 
 

powered by: WebSVN 2.1.0

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