]> Zhao Yanbai Git Server - minix.git/commitdiff
fix for ld.so @ bitcode build
authorBen Gras <ben@minix3.org>
Sun, 4 May 2014 11:52:22 +0000 (13:52 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:12 +0000 (17:05 +0200)
ld.so linked with gold didn't work - gold was not generating
the _DYNAMIC ptr in the first GOT entry, leaving it zero, causing
mayhem for ld.so.

  . patch for gold: always generate _DYNAMIC ptr. submitted upstream,
    more info here: https://sourceware.org/bugzilla/show_bug.cgi?id=16900
  . revert "REMOVE ME: Static tests for now" - we can link tests dynamically
    This reverts commit 3e0a3993deb831eb5abcd1c1a2cb1246b43f8d1d.

Change-Id: I4f2910ec2592c31bbd14a85d8a6045497fcaf4e3

external/gpl3/binutils/patches/0006-gold-plt.patch [new file with mode: 0644]

diff --git a/external/gpl3/binutils/patches/0006-gold-plt.patch b/external/gpl3/binutils/patches/0006-gold-plt.patch
new file mode 100644 (file)
index 0000000..f7fe9f6
--- /dev/null
@@ -0,0 +1,21 @@
+commit 31245c9b262fa983d9711f7795b35ad31c3a6618
+Author: Ben Gras <ben@minix3.org>
+Date:   Sat May 3 19:40:19 2014 +0200
+
+    plt
+
+diff --git a/gold/i386.cc b/gold/i386.cc
+index a2f7522..f06d60d 100644
+--- a/gold/i386.cc
++++ b/gold/i386.cc
+@@ -2543,6 +2543,10 @@ Target_i386::do_finalize_sections(
+   Symbol* sym = this->global_offset_table_;
+   if (sym != NULL)
+     {
++      // create a plt
++      if (this->plt_ == NULL)
++        this->make_plt_section(symtab, layout);
++
+       uint32_t data_size = this->got_plt_->current_data_size();
+       symtab->get_sized_symbol<32>(sym)->set_symsize(data_size);
+     }