public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [AArch64] Remove redundant calculation of plt stub destination for veneer
@ 2015-12-16 13:07 Jiong Wang
  2016-02-22 11:52 ` [Ping] " Jiong Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Jiong Wang @ 2015-12-16 13:07 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

elfNN_aarch64_size_stubs, the caller of aarch64_type_stub has redirected
the final destination of long branch veneer to plt stub if the call
should go through it.

It's redundant to do the same check and redirect again from scratch
inside aarch64_type_stub.

build & native check-ld OK.

OK for trunk?

2015-12-16  Jiong Wang  <jiong.wang@arm.com>

bfd/
   * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
   for destination.  Remove useless function parameters.
   (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.

-- 
Regards,
Jiong


[-- Attachment #2: j.patch --]
[-- Type: text/x-patch, Size: 1859 bytes --]

diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index 59c51cc..37bbef1 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -2639,34 +2639,21 @@ aarch64_select_branch_stub (bfd_vma value, bfd_vma place)
 /* Determine the type of stub needed, if any, for a call.  */
 
 static enum elf_aarch64_stub_type
-aarch64_type_of_stub (struct bfd_link_info *info,
-		      asection *input_sec,
+aarch64_type_of_stub (asection *input_sec,
 		      const Elf_Internal_Rela *rel,
 		      asection *sym_sec,
 		      unsigned char st_type,
-		      struct elf_aarch64_link_hash_entry *hash,
 		      bfd_vma destination)
 {
   bfd_vma location;
   bfd_signed_vma branch_offset;
   unsigned int r_type;
-  struct elf_aarch64_link_hash_table *globals;
   enum elf_aarch64_stub_type stub_type = aarch64_stub_none;
-  bfd_boolean via_plt_p;
 
   if (st_type != STT_FUNC
       && (sym_sec != bfd_abs_section_ptr))
     return stub_type;
 
-  globals = elf_aarch64_hash_table (info);
-  via_plt_p = (globals->root.splt != NULL && hash != NULL
-	       && hash->root.plt.offset != (bfd_vma) - 1);
-  /* Make sure call to plt stub can fit into the branch range.  */
-  if (via_plt_p)
-    destination = (globals->root.splt->output_section->vma
-		   + globals->root.splt->output_offset
-		   + hash->root.plt.offset);
-
   /* Determine where the call point is.  */
   location = (input_sec->output_offset
 	      + input_sec->output_section->vma + rel->r_offset);
@@ -4142,8 +4129,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd,
 		    }
 
 		  /* Determine what (if any) linker stub is needed.  */
-		  stub_type = aarch64_type_of_stub
-		    (info, section, irela, sym_sec, st_type, hash, destination);
+		  stub_type = aarch64_type_of_stub (section, irela, sym_sec,
+						    st_type, destination);
 		  if (stub_type == aarch64_stub_none)
 		    continue;
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Ping] Re: [AArch64] Remove redundant calculation of plt stub destination for veneer
  2015-12-16 13:07 [AArch64] Remove redundant calculation of plt stub destination for veneer Jiong Wang
@ 2016-02-22 11:52 ` Jiong Wang
  2016-02-22 11:54   ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Jiong Wang @ 2016-02-22 11:52 UTC (permalink / raw)
  To: binutils


On 16/12/15 13:07, Jiong Wang wrote:
> elfNN_aarch64_size_stubs, the caller of aarch64_type_stub has redirected
> the final destination of long branch veneer to plt stub if the call
> should go through it.
>
> It's redundant to do the same check and redirect again from scratch
> inside aarch64_type_stub.
>
> build & native check-ld OK.
>
> OK for trunk?
>
> 2015-12-16  Jiong Wang  <jiong.wang@arm.com>
>
> bfd/
>   * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
>   for destination.  Remove useless function parameters.
>   (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.
>
Ping.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Ping] Re: [AArch64] Remove redundant calculation of plt stub destination for veneer
  2016-02-22 11:52 ` [Ping] " Jiong Wang
@ 2016-02-22 11:54   ` Nick Clifton
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2016-02-22 11:54 UTC (permalink / raw)
  To: Jiong Wang, binutils

Hi Jiong,

>> OK for trunk?
>>
>> 2015-12-16  Jiong Wang  <jiong.wang@arm.com>
>>
>> bfd/
>>   * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
>>   for destination.  Remove useless function parameters.
>>   (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.

> Ping.

oops - sorry - I missed that one.

Patch approved - please apply.

Cheers
  Nick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-22 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-16 13:07 [AArch64] Remove redundant calculation of plt stub destination for veneer Jiong Wang
2016-02-22 11:52 ` [Ping] " Jiong Wang
2016-02-22 11:54   ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).