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/binutils-2_29-branch] PR21017, microblaze missing _GLOBAL_OFFSET_TABLE_ symbol


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

commit 51bd0f967a9a9dfddaa267b4b6fb2e653d252026
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Aug 8 14:05:33 2017 +0930

    PR21017, microblaze missing _GLOBAL_OFFSET_TABLE_ symbol
    
    	PR 21017
    	* elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
    	got.refcount for GOTOFF relocs, just create .got section.

Diff:
---
 bfd/ChangeLog          |  6 ++++++
 bfd/elf32-microblaze.c | 12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 048bf14..211e340 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-08  Alan Modra  <amodra@gmail.com>
+
+	PR 21017
+	* elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
+	got.refcount for GOTOFF relocs, just create .got section.
+
 2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
 	Backport from mainline
diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
index 2657736..94ef09e 100644
--- a/bfd/elf32-microblaze.c
+++ b/bfd/elf32-microblaze.c
@@ -2353,7 +2353,6 @@ microblaze_elf_check_relocs (bfd * abfd,
         dogottls:
           sec->has_tls_reloc = 1;
 	  /* Fall through.  */
-        case R_MICROBLAZE_GOTOFF_64:
         case R_MICROBLAZE_GOT_64:
           if (htab->elf.sgot == NULL)
             {
@@ -2374,6 +2373,17 @@ microblaze_elf_check_relocs (bfd * abfd,
 	    }
           break;
 
+	case R_MICROBLAZE_GOTOFF_64:
+	case R_MICROBLAZE_GOTOFF_32:
+	  if (htab->elf.sgot == NULL)
+	    {
+	      if (htab->elf.dynobj == NULL)
+		htab->elf.dynobj = abfd;
+	      if (!_bfd_elf_create_got_section (htab->elf.dynobj, info))
+		return FALSE;
+	    }
+	  break;
+
         case R_MICROBLAZE_64:
         case R_MICROBLAZE_64_PCREL:
         case R_MICROBLAZE_32:


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