aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-12-03 05:30:59 +0000
committerAlan Modra <amodra@gmail.com>2012-12-03 05:30:59 +0000
commitec661b9dca95a55df264edaaa430dd6183ad2adf (patch)
tree3fe1dd21cc67d3af02e77b2a761128f3f5052e4b /gold/output.cc
parent0f6752b51fa8d4e6119c662eb17520f7ee5a6007 (diff)
downloadgdb-ec661b9dca95a55df264edaaa430dd6183ad2adf.zip
gdb-ec661b9dca95a55df264edaaa430dd6183ad2adf.tar.gz
gdb-ec661b9dca95a55df264edaaa430dd6183ad2adf.tar.bz2
* layout.h (Layout::get_executable_sections): Declare.
* layout.cc (Layout::get_executable_sections): New function. * arm.cc (Target_arm::group_sections): Use it. (Arm_output_section::group_sections): Delete now redundant test. * output.cc (Output_reloc::Output_reloc): Add is_relative. param to handle relative relocs. * output.h (Output_reloc::Output_reloc <absolute reloc>): Likewise. (Output_data_reloc::add_absolute): Adjust. (Output_data_reloc::add_relative): New function. (Output_data::reset_data_size): New function. (Output_relaxed_input_section::set_relobj, set_shndx): New functions. (Output_section::set_addralign): New function. (Output_section::checkpoint_set_addralign): New function. (Output_section::clear_section_offsets_need_adjustment): New function. (Output_section::input_sections): Make public. * powerpc.cc (class Output_data_brlt_powerpc): New. (class Stub_table, class Stub_control): New. (Powerpc_relobj::has14_, set_has_14bit_branch, has_14bit_branch, stub_table_, set_stub_table, stub_table): New vectors and accessor functions. (Target_powerpc::do_may_relax, do_relax, push_branch, new_stub_table, stub_tables, brlt_section, group_sections, add_branch_lookup_table, find_branch_lookup_table, write_branch_lookup_table, make_brlt_section): New functions. (Target_powerpc::struct Sort_sections, class Branch_info): New. (Target_powerpc::brlt_section_, stub_tables_, branch_lookup_table_, branch_info_): New vars. (Target_powerpc::make_plt_entry, make_local_ifunc_plt_entry): Don't make call stubs here. (Output_data_glink): Remove all call stub handling from this class. (Target_powerpc::Scan::local, global): Save interesting branch relocs and relocs for ifunc. Adjust calls to plt entry functions. (Target_powerpc::do_finalize_sections): Only make reg save/restore functions on final link. (Target_powerpc::Relocate::relocate): Adjust lookup of call stubs. Handle long branch destinations too. (Target_powerpc::do_dynsym_value, do_plt_address_for_global, do_plt_address_for_local): Adjust lookup of plt call stubs.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/output.cc b/gold/output.cc
index b47ad4d..9e3b0b4 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -851,15 +851,16 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
os->set_needs_symtab_index();
}
-// An absolute relocation.
+// An absolute or relative relocation.
template<bool dynamic, int size, bool big_endian>
Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
unsigned int type,
Output_data* od,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(0), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(false),
is_section_symbol_(false), use_plt_offset_(false), shndx_(INVALID_CODE)
{
// this->type_ is a bitfield; make sure TYPE fits.
@@ -873,9 +874,10 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::Output_reloc(
unsigned int type,
Sized_relobj<size, big_endian>* relobj,
unsigned int shndx,
- Address address)
+ Address address,
+ bool is_relative)
: address_(address), local_sym_index_(0), type_(type),
- is_relative_(false), is_symbolless_(false),
+ is_relative_(is_relative), is_symbolless_(false),
is_section_symbol_(false), use_plt_offset_(false), shndx_(shndx)
{
gold_assert(shndx != INVALID_CODE);