Pass relocations to Target::do_calls_non_split.

gold/
	* target.h (Target::calls_non_split): Add prelocs, reloc_count
	parameters.
	(Target::do_calls_non_split): Likewise.
	* target.cc (Target::do_calls_non_split): Likewise.
	* reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
	call to Target::calls_non_split.

	* i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
	parameters.
	* powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
	* x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
This commit is contained in:
Cary Coutant 2015-12-11 14:20:41 -08:00
parent 6b2353a53a
commit 6e0813d359
7 changed files with 32 additions and 4 deletions

View file

@ -1,3 +1,16 @@
2015-12-11 Cary Coutant <ccoutant@gmail.com>
* target.h (Target::calls_non_split): Add prelocs, reloc_count
parameters.
(Target::do_calls_non_split): Likewise.
* target.cc (Target::do_calls_non_split): Likewise.
* reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Adjust
call to Target::calls_non_split.
* i386.cc (Target_i386::do_calls_non_split): Add prelocs, reloc_count
parameters.
* powerpc.cc (Target_powerpc::do_calls_non_split): Likewise.
* x86_64.cc (Target_x86_64::do_calls_non_split): Likewise.
2015-12-11 Cary Coutant <ccoutant@gmail.com>
* object.cc (Sized_relobj_file::Sized_relobj_file): Initialize

View file

@ -491,6 +491,7 @@ class Target_i386 : public Sized_target<32, false>
void
do_calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset, section_size_type fnsize,
const unsigned char* prelocs, size_t reloc_count,
unsigned char* view, section_size_type view_size,
std::string* from, std::string* to) const;
@ -3881,6 +3882,8 @@ void
Target_i386::do_calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset,
section_size_type fnsize,
const unsigned char*,
size_t,
unsigned char* view,
section_size_type view_size,
std::string* from,

View file

@ -631,6 +631,7 @@ class Target_powerpc : public Sized_target<size, big_endian>
void
do_calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset, section_size_type fnsize,
const unsigned char* prelocs, size_t reloc_count,
unsigned char* view, section_size_type view_size,
std::string* from, std::string* to) const;
@ -6590,6 +6591,8 @@ Target_powerpc<size, big_endian>::do_calls_non_split(
unsigned int shndx,
section_offset_type fnoffset,
section_size_type fnsize,
const unsigned char* prelocs,
size_t reloc_count,
unsigned char* view,
section_size_type view_size,
std::string* from,
@ -6600,7 +6603,8 @@ Target_powerpc<size, big_endian>::do_calls_non_split(
{
// warn
Target::do_calls_non_split(object, shndx, fnoffset, fnsize,
view, view_size, from, to);
prelocs, reloc_count, view, view_size,
from, to);
return;
}

View file

@ -1364,6 +1364,7 @@ Sized_relobj_file<size, big_endian>::split_stack_adjust_reltype(
std::string from;
std::string to;
parameters->target().calls_non_split(this, shndx, p->first, p->second,
prelocs, reloc_count,
view, view_size, &from, &to);
if (!from.empty())
{

View file

@ -161,7 +161,8 @@ Target::do_is_call_to_non_split(const Symbol* sym, unsigned int) const
void
Target::do_calls_non_split(Relobj* object, unsigned int, section_offset_type,
section_size_type, unsigned char*, section_size_type,
section_size_type, const unsigned char*, size_t,
unsigned char*, section_size_type,
std::string*, std::string*) const
{
static bool warned;

View file

@ -338,10 +338,12 @@ class Target
void
calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset, section_size_type fnsize,
const unsigned char* prelocs, size_t reloc_count,
unsigned char* view, section_size_type view_size,
std::string* from, std::string* to) const
{
this->do_calls_non_split(object, shndx, fnoffset, fnsize, view, view_size,
this->do_calls_non_split(object, shndx, fnoffset, fnsize,
prelocs, reloc_count, view, view_size,
from, to);
}
@ -664,7 +666,8 @@ class Target
// Virtual function which may be overridden by the child class.
virtual void
do_calls_non_split(Relobj* object, unsigned int, section_offset_type,
section_size_type, unsigned char*, section_size_type,
section_size_type, const unsigned char*, size_t,
unsigned char*, section_size_type,
std::string*, std::string*) const;
// make_elf_object hooks. There are four versions of these for

View file

@ -561,6 +561,7 @@ class Target_x86_64 : public Sized_target<size, false>
void
do_calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset, section_size_type fnsize,
const unsigned char* prelocs, size_t reloc_count,
unsigned char* view, section_size_type view_size,
std::string* from, std::string* to) const;
@ -4597,6 +4598,8 @@ void
Target_x86_64<size>::do_calls_non_split(Relobj* object, unsigned int shndx,
section_offset_type fnoffset,
section_size_type fnsize,
const unsigned char*,
size_t,
unsigned char* view,
section_size_type view_size,
std::string* from,