From 966d4097440bd7c3e35524bebf39d8bbe2e26fd6 Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Thu, 1 Oct 2009 00:58:38 +0000 Subject: 2009-09-30 Doug Kwan * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function symbol and call Symbol::may_need_copy_reloc to determine if a copy reloc is needed. * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z nocopyreloc is given in command line. (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not given in command line. * i386.cc (Target_i386::may_need_copy_reloc): Remove. (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead of the removed Target_i386::may_need_copy_reloc. * options.h (copyreloc): New option with default value false. * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove. (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc instead of the removed Target_powerpc::may_need_copy_reloc. * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove. (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc instead of the removed Target_sparc::may_need_copy_reloc. * symtab.h (Symbol::may_need_copy_reloc): New method definition. * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove. (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc instead of the removed Target_x86_64::may_need_copy_reloc. --- gold/copy-relocs.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gold/copy-relocs.cc') diff --git a/gold/copy-relocs.cc b/gold/copy-relocs.cc index 80b50df..6ef72d3 100644 --- a/gold/copy-relocs.cc +++ b/gold/copy-relocs.cc @@ -84,7 +84,8 @@ Copy_relocs::need_copy_reloc( Sized_relobj* object, unsigned int shndx) const { - // FIXME: Handle -z nocopyrelocs. + if (!parameters->options().copyreloc()) + return false; if (sym->symsize() == 0) return false; @@ -109,6 +110,9 @@ Copy_relocs::emit_copy_reloc( Sized_symbol* sym, Output_data_reloc* reloc_section) { + // We should not be here if -z nocopyreloc is given. + gold_assert(parameters->options().copyreloc()); + typename elfcpp::Elf_types::Elf_WXword symsize = sym->symsize(); // There is no defined way to determine the required alignment of -- cgit v1.1