This is the mail archive of the binutils-cvs@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]

[binutils-gdb] [ARC] Reassign the symbol got information to actual symbol when indirect.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc89d0b3344614ae97456df84034096b698e5790

commit cc89d0b3344614ae97456df84034096b698e5790
Author: Cupertino Miranda <cmiranda@synopsys.com>
Date:   Mon Oct 24 22:19:48 2016 +0200

    [ARC] Reassign the symbol got information to actual symbol when indirect.
    
    GOT information would not be reassign to symbol when it became a indect
    symbol.
    
    bfd/ChangeLog:
    
        Cupertino Miranda  <cmiranda@synopsys.com>
    
    	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
    	symbols.

Diff:
---
 bfd/ChangeLog   | 5 +++++
 bfd/elf32-arc.c | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ba36919..a436e2e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
 
+	* elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
+	symbols.
+
+2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
+
 	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
 	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
 
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 8aec9ea..26e1bd4 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1588,7 +1588,12 @@ elf_arc_relocate_section (bfd *		          output_bfd,
 
 	  while (h->root.type == bfd_link_hash_indirect
 		 || h->root.type == bfd_link_hash_warning)
+	  {
+	    struct elf_link_hash_entry *h_old = h;
 	    h = (struct elf_link_hash_entry *) h->root.u.i.link;
+	    if (h->got.glist == 0 && h_old->got.glist != h->got.glist)
+	      h->got.glist = h_old->got.glist;
+	  }
 
 	  /* TODO: Need to validate what was the intention.  */
 	  /* BFD_ASSERT ((h->dynindx == -1) || (h->forced_local != 0)); */


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