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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [target.cc] - Diff between revs 27 and 159

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 27 Rev 159
Line 1... Line 1...
// target.cc
// target.cc -- target support for gold.
 
 
// Copyright 2009, 2010 Free Software Foundation, Inc.
// Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
// Written by Doug Kwan <dougkwan@google.com>.
// Written by Doug Kwan <dougkwan@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
Line 70... Line 70...
    Input_file* input_file,
    Input_file* input_file,
    off_t offset,
    off_t offset,
    const elfcpp::Ehdr<size, big_endian>& ehdr)
    const elfcpp::Ehdr<size, big_endian>& ehdr)
{
{
  int et = ehdr.get_e_type();
  int et = ehdr.get_e_type();
  if (et == elfcpp::ET_REL)
  // ET_EXEC files are valid input for --just-symbols/-R,
 
  // and we treat them as relocatable objects.
 
  if (et == elfcpp::ET_REL
 
      || (et == elfcpp::ET_EXEC && input_file->just_symbols()))
    {
    {
      Sized_relobj_file<size, big_endian>* obj =
      Sized_relobj_file<size, big_endian>* obj =
        new Sized_relobj_file<size, big_endian>(name, input_file, offset, ehdr);
        new Sized_relobj_file<size, big_endian>(name, input_file, offset, ehdr);
      obj->setup();
      obj->setup();
      return obj;
      return obj;
Line 198... Line 201...
      std::string fill = this->code_fill(len);
      std::string fill = this->code_fill(len);
      memcpy(view + offset, fill.data(), len);
      memcpy(view + offset, fill.data(), len);
    }
    }
}
}
 
 
 
// Class Sized_target.
 
 
 
// Set the EI_OSABI field of the ELF header if requested.
 
 
 
template<int size, bool big_endian>
 
void
 
Sized_target<size, big_endian>::do_adjust_elf_header(unsigned char* view,
 
                                                     int len) const
 
{
 
  elfcpp::ELFOSABI osabi = this->osabi();
 
  if (osabi != elfcpp::ELFOSABI_NONE)
 
    {
 
      gold_assert(len == elfcpp::Elf_sizes<size>::ehdr_size);
 
 
 
      elfcpp::Ehdr<size, false> ehdr(view);
 
      unsigned char e_ident[elfcpp::EI_NIDENT];
 
      memcpy(e_ident, ehdr.get_e_ident(), elfcpp::EI_NIDENT);
 
 
 
      e_ident[elfcpp::EI_OSABI] = osabi;
 
 
 
      elfcpp::Ehdr_write<size, false> oehdr(view);
 
      oehdr.put_e_ident(e_ident);
 
    }
 
}
 
 
 
#ifdef HAVE_TARGET_32_LITTLE
 
template
 
class Sized_target<32, false>;
 
#endif
 
 
 
#ifdef HAVE_TARGET_32_BIG
 
template
 
class Sized_target<32, true>;
 
#endif
 
 
 
#ifdef HAVE_TARGET_64_LITTLE
 
template
 
class Sized_target<64, false>;
 
#endif
 
 
 
#ifdef HAVE_TARGET_64_BIG
 
template
 
class Sized_target<64, true>;
 
#endif
 
 
} // End namespace gold.
} // End namespace gold.
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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