daily update
[deliverable/binutils-gdb.git] / gold / reloc.cc
index 9ffb693b487255a0c03da40d6184bb539f75d8ae..bacf52c8da02fcb643f088de9003e786a23c6b07 100644 (file)
@@ -1,6 +1,6 @@
 // reloc.cc -- relocate input files for gold.
 
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -369,7 +369,7 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
 }
 
 // Process the relocs to generate mappings from source sections to referenced
-// sections.  This is used during garbage colletion to determine garbage 
+// sections.  This is used during garbage collection to determine garbage
 // sections.
 
 template<int size, bool big_endian>
@@ -685,9 +685,6 @@ Sized_relobj<size, big_endian>::do_relocate(const Symbol_table* symtab,
   // Write out the local symbols.
   this->write_local_symbols(of, layout->sympool(), layout->dynpool(),
                            layout->symtab_xindex(), layout->dynsym_xindex());
-
-  // We should no longer need the local symbol values.
-  this->clear_local_symbols();
 }
 
 // Sort a Read_multiple vector by file offset.
@@ -1591,6 +1588,20 @@ Track_relocs<size, big_endian>::next_symndx() const
   return elfcpp::elf_r_sym<size>(rel.get_r_info());
 }
 
+// Return the addend of the next reloc, or 0 if there isn't one.
+
+template<int size, bool big_endian>
+uint64_t
+Track_relocs<size, big_endian>::next_addend() const
+{
+  if (this->pos_ >= this->len_)
+    return 0;
+  if (this->reloc_size_ == elfcpp::Elf_sizes<size>::rel_size)
+    return 0;
+  elfcpp::Rela<size, big_endian> rela(this->prelocs_ + this->pos_);
+  return rela.get_r_addend();
+}
+
 // Advance to the next reloc whose r_offset is greater than or equal
 // to OFFSET.  Return the number of relocs we skip.
 
This page took 0.026895 seconds and 4 git commands to generate.