This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 1/2] gold: Add view and view_size parameters to is_call_to_non_split.


This is needed by s390 split-stack support, to distinguish call
and load-address relocations.

gold/ChangeLog:

	* i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
	parameters.
	* reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
	and view_size to is_call_to_non_split.
	* target.cc (Target::is_call_to_non_split): Add view and view_size
	parameters.
	* target.h (class Target): Likewise.
---
 gold/ChangeLog | 10 ++++++++++
 gold/i386.cc   |  7 +++++--
 gold/reloc.cc  |  3 ++-
 gold/target.cc |  3 ++-
 gold/target.h  |  9 ++++++---
 5 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/gold/ChangeLog b/gold/ChangeLog
index a90ffa4..e8dbd3c 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,13 @@
+2016-02-05  Marcin KoÅcielnicki  <koriakin@0x04.net>
+
+	* i386.cc (Target_i386::is_call_to_non_split): Add view and view_size
+	parameters.
+	* reloc.cc (Sized_relobj_file::split_stack_adjust_reltype): Pass view
+	and view_size to is_call_to_non_split.
+	* target.cc (Target::is_call_to_non_split): Add view and view_size
+	parameters.
+	* target.h (class Target): Likewise.
+
 2016-02-05  Cary Coutant  <ccoutant@gmail.com>
 	    Andrew Senkevich  <andrew.senkevich@intel.com>
 
diff --git a/gold/i386.cc b/gold/i386.cc
index 7946cf7..8bcd44e 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -500,7 +500,8 @@ class Target_i386 : public Sized_target<32, false>
 
   // Return whether SYM is call to a non-split function.
   bool
-  do_is_call_to_non_split(const Symbol* sym, const unsigned char*) const;
+  do_is_call_to_non_split(const Symbol* sym, const unsigned char*,
+			  const unsigned char*, section_size_type) const;
 
   // Adjust -fsplit-stack code which calls non-split-stack code.
   void
@@ -3916,7 +3917,9 @@ Target_i386::do_ehframe_datarel_base() const
 
 bool
 Target_i386::do_is_call_to_non_split(const Symbol* sym,
-				     const unsigned char*) const
+				     const unsigned char*,
+				     const unsigned char*,
+				     section_size_type) const
 {
   return (sym->type() == elfcpp::STT_FUNC
 	  && !is_prefix_of("__i686.get_pc_thunk.", sym->name()));
diff --git a/gold/reloc.cc b/gold/reloc.cc
index b1a50e6..ca54f15 100644
--- a/gold/reloc.cc
+++ b/gold/reloc.cc
@@ -1251,7 +1251,8 @@ Sized_relobj_file<size, big_endian>::split_stack_adjust_reltype(
 	  && gsym->source() == Symbol::FROM_OBJECT
 	  && !gsym->object()->uses_split_stack())
 	{
-	  if (parameters->target().is_call_to_non_split(gsym, pr))
+	  if (parameters->target().is_call_to_non_split(gsym, pr, view,
+							view_size))
 	    {
 	      Reltype reloc(pr);
 	      section_offset_type offset =
diff --git a/gold/target.cc b/gold/target.cc
index cc3765a..3bae2dd 100644
--- a/gold/target.cc
+++ b/gold/target.cc
@@ -152,7 +152,8 @@ Target::do_make_output_section(const char* name, elfcpp::Elf_Word type,
 // whether the symbol is a function.
 
 bool
-Target::do_is_call_to_non_split(const Symbol* sym, const unsigned char*) const
+Target::do_is_call_to_non_split(const Symbol* sym, const unsigned char*,
+				const unsigned char*, section_size_type) const
 {
   return sym->type() == elfcpp::STT_FUNC;
 }
diff --git a/gold/target.h b/gold/target.h
index c0f24ee..d20044e 100644
--- a/gold/target.h
+++ b/gold/target.h
@@ -326,8 +326,10 @@ class Target
   // without -fsplit-stack.  SYM is known to be defined in an object
   // compiled without -fsplit-stack.
   bool
-  is_call_to_non_split(const Symbol* sym, const unsigned char* preloc) const
-  { return this->do_is_call_to_non_split(sym, preloc); }
+  is_call_to_non_split(const Symbol* sym, const unsigned char* preloc,
+		       const unsigned char* view,
+		       section_size_type view_size) const
+  { return this->do_is_call_to_non_split(sym, preloc, view, view_size); }
 
   // A function starts at OFFSET in section SHNDX in OBJECT.  That
   // function was compiled with -fsplit-stack, but it refers to a
@@ -661,7 +663,8 @@ class Target
   // default implementation is that any function not defined by the
   // ABI is a call to a non-split function.
   virtual bool
-  do_is_call_to_non_split(const Symbol* sym, const unsigned char*) const;
+  do_is_call_to_non_split(const Symbol* sym, const unsigned char*,
+			  const unsigned char*, section_size_type) const;
 
   // Virtual function which may be overridden by the child class.
   virtual void
-- 
2.7.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]