summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/gold/copy-relocs.h
diff options
context:
space:
mode:
Diffstat (limited to 'binutils-2.25/gold/copy-relocs.h')
-rw-r--r--binutils-2.25/gold/copy-relocs.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/binutils-2.25/gold/copy-relocs.h b/binutils-2.25/gold/copy-relocs.h
index d1e2323b..800c0e7e 100644
--- a/binutils-2.25/gold/copy-relocs.h
+++ b/binutils-2.25/gold/copy-relocs.h
@@ -1,6 +1,6 @@
// copy-relocs.h -- handle COPY relocations for gold -*- C++ -*-
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright (C) 2006-2014 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
@@ -54,7 +54,7 @@ class Copy_relocs
public:
Copy_relocs(unsigned int copy_reloc_type)
- : copy_reloc_type_(copy_reloc_type), dynbss_(NULL), entries_()
+ : entries_(), copy_reloc_type_(copy_reloc_type), dynbss_(NULL)
{ }
// This is called while scanning relocs if we see a relocation
@@ -87,16 +87,15 @@ class Copy_relocs
Output_data*, off_t,
Output_data_reloc<sh_type, true, size, big_endian>*);
- private:
+ protected:
typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
typedef typename elfcpp::Elf_types<size>::Elf_Addr Addend;
// This POD class holds the relocations we are saving. We will emit
// these relocations if it turns out that the symbol does not
// require a COPY relocation.
- class Copy_reloc_entry
+ struct Copy_reloc_entry
{
- public:
Copy_reloc_entry(Symbol* sym, unsigned int reloc_type,
Sized_relobj_file<size, big_endian>* relobj,
unsigned int shndx,
@@ -107,13 +106,6 @@ class Copy_relocs
address_(address), addend_(addend)
{ }
- // Emit this reloc if appropriate. This is called after we have
- // scanned all the relocations, so we know whether we emitted a
- // COPY relocation for SYM_.
- void
- emit(Output_data_reloc<sh_type, true, size, big_endian>*);
-
- private:
Symbol* sym_;
unsigned int reloc_type_;
Sized_relobj_file<size, big_endian>* relobj_;
@@ -123,20 +115,24 @@ class Copy_relocs
Addend addend_;
};
+ // Make a new COPY reloc and emit it.
+ void
+ make_copy_reloc(Symbol_table*, Layout*, Sized_symbol<size>*,
+ Output_data_reloc<sh_type, true, size, big_endian>*);
+
// A list of relocs to be saved.
typedef std::vector<Copy_reloc_entry> Copy_reloc_entries;
+ // The list of relocs we are saving.
+ Copy_reloc_entries entries_;
+
+ private:
// Return whether we need a COPY reloc.
bool
need_copy_reloc(Sized_symbol<size>* gsym,
Sized_relobj_file<size, big_endian>* object,
unsigned int shndx) const;
- // Make a new COPY reloc and emit it.
- void
- make_copy_reloc(Symbol_table*, Layout*, Sized_symbol<size>*,
- Output_data_reloc<sh_type, true, size, big_endian>*);
-
// Save a reloc against SYM for possible emission later.
void
save(Symbol*, Sized_relobj_file<size, big_endian>*, unsigned int shndx,
@@ -147,8 +143,6 @@ class Copy_relocs
// The dynamic BSS data which goes into the .bss section. This is
// where variables which require COPY relocations are placed.
Output_data_space* dynbss_;
- // The list of relocs we are saving.
- Copy_reloc_entries entries_;
};
} // End namespace gold.