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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [copy-relocs.cc] - Diff between revs 27 and 148

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

Rev 27 Rev 148
Line 63... Line 63...
    Output_section* output_section,
    Output_section* output_section,
    const Reloc& rel,
    const Reloc& rel,
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
{
{
  if (this->need_copy_reloc(sym, object, shndx))
  if (this->need_copy_reloc(sym, object, shndx))
    this->emit_copy_reloc(symtab, layout, sym, reloc_section);
    this->make_copy_reloc(symtab, layout, sym, reloc_section);
  else
  else
    {
    {
      // We may not need a COPY relocation.  Save this relocation to
      // We may not need a COPY relocation.  Save this relocation to
      // possibly be emitted later.
      // possibly be emitted later.
      this->save(sym, object, shndx, output_section, rel);
      this->save(sym, object, shndx, output_section, rel);
Line 104... Line 104...
 
 
template<int sh_type, int size, bool big_endian>
template<int sh_type, int size, bool big_endian>
void
void
Copy_relocs<sh_type, size, big_endian>::emit_copy_reloc(
Copy_relocs<sh_type, size, big_endian>::emit_copy_reloc(
    Symbol_table* symtab,
    Symbol_table* symtab,
 
    Sized_symbol<size>* sym,
 
    Output_data* posd,
 
    off_t offset,
 
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
 
{
 
  // Define the symbol as being copied.
 
  symtab->define_with_copy_reloc(sym, posd, offset);
 
 
 
  // Add the COPY relocation to the dynamic reloc section.
 
  reloc_section->add_global(sym, this->copy_reloc_type_, posd, offset, 0);
 
}
 
 
 
// Make a COPY relocation for SYM and emit it.
 
 
 
template<int sh_type, int size, bool big_endian>
 
void
 
Copy_relocs<sh_type, size, big_endian>::make_copy_reloc(
 
    Symbol_table* symtab,
    Layout* layout,
    Layout* layout,
    Sized_symbol<size>* sym,
    Sized_symbol<size>* sym,
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
{
{
  // We should not be here if -z nocopyreloc is given.
  // We should not be here if -z nocopyreloc is given.
Line 162... Line 180...
    convert_to_section_size_type(dynbss->current_data_size());
    convert_to_section_size_type(dynbss->current_data_size());
  dynbss_size = align_address(dynbss_size, addralign);
  dynbss_size = align_address(dynbss_size, addralign);
  section_size_type offset = dynbss_size;
  section_size_type offset = dynbss_size;
  dynbss->set_current_data_size(dynbss_size + symsize);
  dynbss->set_current_data_size(dynbss_size + symsize);
 
 
  // Define the symbol as being copied.
  this->emit_copy_reloc(symtab, sym, dynbss, offset, reloc_section);
  symtab->define_with_copy_reloc(sym, dynbss, offset);
 
 
 
  // Add the COPY relocation to the dynamic reloc section.
 
  this->add_copy_reloc(sym, offset, reloc_section);
 
}
 
 
 
// Add a COPY relocation for SYM to RELOC_SECTION.
 
 
 
template<int sh_type, int size, bool big_endian>
 
void
 
Copy_relocs<sh_type, size, big_endian>::add_copy_reloc(
 
    Symbol* sym,
 
    section_size_type offset,
 
    Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
 
{
 
  reloc_section->add_global(sym, this->copy_reloc_type_, this->dynbss_,
 
                            offset, 0);
 
}
}
 
 
// Save a relocation to possibly be emitted later.
// Save a relocation to possibly be emitted later.
 
 
template<int sh_type, int size, bool big_endian>
template<int sh_type, int size, bool big_endian>

powered by: WebSVN 2.1.0

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