mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-13 02:14:39 +08:00
* output.cc (Output_reloc::get_address): Change return type to
Elf_Addr. * output.h (class Output_reloc): Update get_address declaration. * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types for section addresses.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2008-05-16 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
|
* output.cc (Output_reloc::get_address): Change return type to
|
||||||
|
Elf_Addr.
|
||||||
|
* output.h (class Output_reloc): Update get_address declaration.
|
||||||
|
* x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
|
||||||
|
for section addresses.
|
||||||
|
|
||||||
2008-05-09 Ian Lance Taylor <iant@google.com>
|
2008-05-09 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
PR 6493
|
PR 6493
|
||||||
|
@ -854,7 +854,7 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::
|
|||||||
// Get the output address of a relocation.
|
// Get the output address of a relocation.
|
||||||
|
|
||||||
template<bool dynamic, int size, bool big_endian>
|
template<bool dynamic, int size, bool big_endian>
|
||||||
section_offset_type
|
typename elfcpp::Elf_types<size>::Elf_Addr
|
||||||
Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_address() const
|
Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_address() const
|
||||||
{
|
{
|
||||||
Address address = this->address_;
|
Address address = this->address_;
|
||||||
|
@ -878,7 +878,7 @@ class Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>
|
|||||||
get_symbol_index() const;
|
get_symbol_index() const;
|
||||||
|
|
||||||
// Return the output address.
|
// Return the output address.
|
||||||
section_offset_type
|
Address
|
||||||
get_address() const;
|
get_address() const;
|
||||||
|
|
||||||
// Codes for local_sym_index_.
|
// Codes for local_sym_index_.
|
||||||
|
@ -672,20 +672,22 @@ Output_data_plt_x86_64::do_write(Output_file* of)
|
|||||||
unsigned char* pov = oview;
|
unsigned char* pov = oview;
|
||||||
|
|
||||||
// The base address of the .plt section.
|
// The base address of the .plt section.
|
||||||
elfcpp::Elf_types<32>::Elf_Addr plt_address = this->address();
|
elfcpp::Elf_types<64>::Elf_Addr plt_address = this->address();
|
||||||
// The base address of the .got section.
|
// The base address of the .got section.
|
||||||
elfcpp::Elf_types<32>::Elf_Addr got_base = this->got_->address();
|
elfcpp::Elf_types<64>::Elf_Addr got_base = this->got_->address();
|
||||||
// The base address of the PLT portion of the .got section,
|
// The base address of the PLT portion of the .got section,
|
||||||
// which is where the GOT pointer will point, and where the
|
// which is where the GOT pointer will point, and where the
|
||||||
// three reserved GOT entries are located.
|
// three reserved GOT entries are located.
|
||||||
elfcpp::Elf_types<32>::Elf_Addr got_address = this->got_plt_->address();
|
elfcpp::Elf_types<64>::Elf_Addr got_address = this->got_plt_->address();
|
||||||
|
|
||||||
memcpy(pov, first_plt_entry, plt_entry_size);
|
memcpy(pov, first_plt_entry, plt_entry_size);
|
||||||
// We do a jmp relative to the PC at the end of this instruction.
|
// We do a jmp relative to the PC at the end of this instruction.
|
||||||
elfcpp::Swap_unaligned<32, false>::writeval(pov + 2, got_address + 8
|
elfcpp::Swap_unaligned<32, false>::writeval(pov + 2,
|
||||||
- (plt_address + 6));
|
(got_address + 8
|
||||||
elfcpp::Swap<32, false>::writeval(pov + 8, got_address + 16
|
- (plt_address + 6)));
|
||||||
- (plt_address + 12));
|
elfcpp::Swap<32, false>::writeval(pov + 8,
|
||||||
|
(got_address + 16
|
||||||
|
- (plt_address + 12)));
|
||||||
pov += plt_entry_size;
|
pov += plt_entry_size;
|
||||||
|
|
||||||
unsigned char* got_pov = got_view;
|
unsigned char* got_pov = got_view;
|
||||||
|
Reference in New Issue
Block a user