* x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
[binutils-gdb.git] / gold / copy-relocs.cc
index 345c0c64cebec43cc374abfd97d29ed4a7027996..ed8002fff660ed05add6a5cc0bcde7176493900d 100644 (file)
@@ -1,6 +1,6 @@
 // copy-relocs.cc -- handle COPY relocations for gold.
 
-// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -60,7 +60,7 @@ Copy_relocs<sh_type, size, big_endian>::copy_reloc(
     Sized_symbol<size>* sym,
     Sized_relobj<size, big_endian>* object,
     unsigned int shndx,
-    Output_section *output_section,
+    Output_sectionoutput_section,
     const Reloc& rel,
     Output_data_reloc<sh_type, true, size, big_endian>* reloc_section)
 {
@@ -132,13 +132,16 @@ Copy_relocs<sh_type, size, big_endian>::emit_copy_reloc(
   while ((value & (addralign - 1)) != 0)
     addralign >>= 1;
 
+  // Mark the dynamic object as needed for the --as-needed option.
+  sym->object()->set_is_needed();
+
   if (this->dynbss_ == NULL)
     {
       this->dynbss_ = new Output_data_space(addralign, "** dynbss");
       layout->add_output_section_data(".bss",
                                      elfcpp::SHT_NOBITS,
                                      elfcpp::SHF_ALLOC | elfcpp::SHF_WRITE,
-                                     this->dynbss_, false);
+                                     this->dynbss_, ORDER_BSS, false);
     }
 
   Output_data_space* dynbss = this->dynbss_;