From 6766a7a8aadc4a6cf95b7696f52ce710f5481390 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 7 Nov 2012 17:34:23 +0000 Subject: [PATCH] gold/ * target.h (Sized_target::relocate_for_relocatable): Use Elf_Off for offset_in_output_section parameter. (Sized_target::relocate_special_relocatable): Likewise. * arm.cc (Target_arm::relocate_for_relocatable): Likewise. (Target_arm::relocate_special_relocatable): Likewise. * i386.cc (Target_i386::relocate_for_relocatable): Likewise. * powerpc.cc (Target_powerpc::relocate_for_relocatable): Likewise. * sparc.cc (Target_sparc::relocate_for_relocatable): Likewise. * target-reloc.h (relocate_for_relocatable): Likewise. * testsuite/testfile.cc (Target_test): Likewise. * tilegx.cc (Target_tilegx::relocate_for_relocatable): Likewise. * x86_64.cc (Target_x86_64::relocate_for_relocatable): Likewise. --- gold/ChangeLog | 13 +++++++++++++ gold/arm.cc | 10 ++++++---- gold/i386.cc | 5 +++-- gold/powerpc.cc | 5 +++-- gold/sparc.cc | 6 ++++-- gold/target-reloc.h | 9 +++++---- gold/target.h | 6 ++++-- gold/testsuite/testfile.cc | 5 +++-- gold/x86_64.cc | 6 +++--- 9 files changed, 44 insertions(+), 21 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index efe9e62..923de7e 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,18 @@ 2012-11-07 Roland McGrath + * target.h (Sized_target::relocate_for_relocatable): Use Elf_Off + for offset_in_output_section parameter. + (Sized_target::relocate_special_relocatable): Likewise. + * arm.cc (Target_arm::relocate_for_relocatable): Likewise. + (Target_arm::relocate_special_relocatable): Likewise. + * i386.cc (Target_i386::relocate_for_relocatable): Likewise. + * powerpc.cc (Target_powerpc::relocate_for_relocatable): Likewise. + * sparc.cc (Target_sparc::relocate_for_relocatable): Likewise. + * target-reloc.h (relocate_for_relocatable): Likewise. + * testsuite/testfile.cc (Target_test): Likewise. + * tilegx.cc (Target_tilegx::relocate_for_relocatable): Likewise. + * x86_64.cc (Target_x86_64::relocate_for_relocatable): Likewise. + * gold.h: Move inclusion of to after in [ENABLE_NLS] section, and separately at top of [!ENABLE_NLS] section. diff --git a/gold/arm.cc b/gold/arm.cc index fa257a7..d434c9d 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -2293,7 +2293,8 @@ class Target_arm : public Sized_target<32, big_endian> const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off + offset_in_output_section, const Relocatable_relocs*, unsigned char* view, Arm_address view_address, @@ -2309,7 +2310,8 @@ class Target_arm : public Sized_target<32, big_endian> const unsigned char* preloc_in, size_t relnum, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off + offset_in_output_section, unsigned char* view, typename elfcpp::Elf_types<32>::Elf_Addr view_address, @@ -9598,7 +9600,7 @@ Target_arm::relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, Arm_address view_address, @@ -9633,7 +9635,7 @@ Target_arm::relocate_special_relocatable( const unsigned char* preloc_in, size_t relnum, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off offset_in_output_section, unsigned char* view, elfcpp::Elf_types<32>::Elf_Addr view_address, section_size_type, diff --git a/gold/i386.cc b/gold/i386.cc index 47f33a0..4076960 100644 --- a/gold/i386.cc +++ b/gold/i386.cc @@ -414,7 +414,8 @@ class Target_i386 : public Sized_target<32, false> const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off + offset_in_output_section, const Relocatable_relocs*, unsigned char* view, elfcpp::Elf_types<32>::Elf_Addr view_address, @@ -3611,7 +3612,7 @@ Target_i386::relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types<32>::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, elfcpp::Elf_types<32>::Elf_Addr view_address, diff --git a/gold/powerpc.cc b/gold/powerpc.cc index d8e8b82..d813791 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -134,7 +134,8 @@ class Target_powerpc : public Sized_target const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off + offset_in_output_section, const Relocatable_relocs*, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, @@ -2086,7 +2087,7 @@ Target_powerpc::relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, diff --git a/gold/sparc.cc b/gold/sparc.cc index 7b78311..7bed538 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -138,13 +138,15 @@ class Target_sparc : public Sized_target const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off + offset_in_output_section, const Relocatable_relocs*, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, section_size_type view_size, unsigned char* reloc_view, section_size_type reloc_view_size); + // Return whether SYM is defined by the ABI. bool do_is_defined_by_abi(const Symbol* sym) const @@ -4207,7 +4209,7 @@ Target_sparc::relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, diff --git a/gold/target-reloc.h b/gold/target-reloc.h index 6efcdf4..1a58d07 100644 --- a/gold/target-reloc.h +++ b/gold/target-reloc.h @@ -1,6 +1,7 @@ // target-reloc.h -- target specific relocation support -*- C++ -*- -// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012 +// Free Software Foundation, Inc. // Written by Ian Lance Taylor . // This file is part of gold. @@ -93,7 +94,7 @@ scan_relocs( // // FIXME: We should issue a warning if this is an // allocated section; is this the best place to do it? - // + // // FIXME: The old GNU linker would in some cases look // for the linkonce section which caused this section to // be discarded, and, if the other section was the same @@ -305,7 +306,7 @@ relocate_section( // If the local symbol belongs to a section we are discarding, // and that section is a debug section, try to find the // corresponding kept section and map this symbol to its - // counterpart in the kept section. The symbol must not + // counterpart in the kept section. The symbol must not // correspond to a section we are folding. bool is_ordinary; shndx = psymval->input_shndx(&is_ordinary); @@ -600,7 +601,7 @@ relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - typename elfcpp::Elf_types::Elf_Addr offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, diff --git a/gold/target.h b/gold/target.h index 81c8114..caebfc2 100644 --- a/gold/target.h +++ b/gold/target.h @@ -796,7 +796,8 @@ class Sized_target : public Target const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off + offset_in_output_section, const Relocatable_relocs*, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr @@ -827,7 +828,8 @@ class Sized_target : public Target const unsigned char* /* preloc_in */, size_t /* relnum */, Output_section* /* output_section */, - off_t /* offset_in_output_section */, + typename elfcpp::Elf_types::Elf_Off + /* offset_in_output_section */, unsigned char* /* view */, typename elfcpp::Elf_types::Elf_Addr /* view_address */, diff --git a/gold/testsuite/testfile.cc b/gold/testsuite/testfile.cc index e963d4d..19da50b 100644 --- a/gold/testsuite/testfile.cc +++ b/gold/testsuite/testfile.cc @@ -74,8 +74,9 @@ class Target_test : public Sized_target void relocate_for_relocatable(const Relocate_info*, unsigned int, const unsigned char*, size_t, - Output_section*, off_t, const Relocatable_relocs*, - unsigned char*, + Output_section*, + typename elfcpp::Elf_types::Elf_Off, + const Relocatable_relocs*, unsigned char*, typename elfcpp::Elf_types::Elf_Addr, section_size_type, unsigned char*, section_size_type) diff --git a/gold/x86_64.cc b/gold/x86_64.cc index 2ac29bf..b5b616f 100644 --- a/gold/x86_64.cc +++ b/gold/x86_64.cc @@ -477,7 +477,7 @@ class Target_x86_64 : public Sized_target const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off offset_in_output_section, const Relocatable_relocs*, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, @@ -2299,7 +2299,7 @@ Target_x86_64::Scan::local(Symbol_table* symtab, unsigned int r_sym = elfcpp::elf_r_sym(reloc.get_r_info()); Reloc_section* rela_dyn = target->rela_dyn_section(layout); rela_dyn->add_local_relative(object, r_sym, - (size == 32 + (size == 32 ? elfcpp::R_X86_64_RELATIVE64 : elfcpp::R_X86_64_RELATIVE), output_section, data_shndx, @@ -4214,7 +4214,7 @@ Target_x86_64::relocate_for_relocatable( const unsigned char* prelocs, size_t reloc_count, Output_section* output_section, - off_t offset_in_output_section, + typename elfcpp::Elf_types::Elf_Off offset_in_output_section, const Relocatable_relocs* rr, unsigned char* view, typename elfcpp::Elf_types::Elf_Addr view_address, -- 2.7.4