Re: Bug#847527: FTBFS on mips*

Aurelien Jarno <[email protected]>
Newsgroups gmane.linux.debian.ports.mips
Message-ID <[email protected]>
Hi,

Thanks for doing an upload addressing this bug. Unfortunately the wrong
fix got applied, so the problem is still there. Bug#844227 is about
PR20828 upstream, while the 2.27.90.20170113-1 upload addresses PR20649
instead, like said in the changelog. PR20649 was already addressed, so
the pr20649.diff patch has just been refreshed in the upload.

Please find attached a debdiff to fully fix the bug PR20828. It only
touches MIPS code, so there is no risk for the other architectures.

Thanks,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
[email protected]                 http://www.aurel32.net
binutils_bug847527_pr20848.debdiff (text/plain, 4 KB)
diff -u binutils-2.27.90.20170113/debian/changelog binutils-2.27.90.20170113/debian/changelog
--- binutils-2.27.90.20170113/debian/changelog
+++ binutils-2.27.90.20170113/debian/changelog
@@ -1,3 +1,10 @@
+binutils (2.27.90.20170113-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply proposed patch for PR ld/20828 (mips). Closes: #844227.
+
+ -- Aurelien Jarno <[email protected]>  Fri, 13 Jan 2017 20:23:50 +0100
+
 binutils (2.27.90.20170113-1) unstable; urgency=medium
 
   * New upstream snapshot, taken from the binutils 2.28 branch.
diff -u binutils-2.27.90.20170113/debian/patches/series binutils-2.27.90.20170113/debian/patches/series
--- binutils-2.27.90.20170113/debian/patches/series
+++ binutils-2.27.90.20170113/debian/patches/series
@@ -28,4 +28,5 @@
 ld-new-dtags-by-default.diff
 pr20649.diff
+pr20828.diff
 
 # patches taken from the trunk
only in patch2:
unchanged:
--- binutils-2.27.90.20170113.orig/debian/patches/pr20828.diff
+++ binutils-2.27.90.20170113/debian/patches/pr20828.diff
@@ -0,0 +1,83 @@
+# DP: Proposed patch for PR ld/20828 (mips).
+
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -743,6 +743,8 @@ static struct mips_got_entry *mips_elf_create_local_got_entry
+    struct mips_elf_link_hash_entry *, int);
+ static bfd_boolean mips_elf_sort_hash_table_f
+   (struct mips_elf_link_hash_entry *, void *);
++static bfd_boolean mips_elf_sort_hash_table_local_f
++  (struct mips_elf_link_hash_entry *, void *);
+ static bfd_vma mips_elf_high
+   (bfd_vma);
+ static bfd_boolean mips_elf_create_dynamic_relocation
+@@ -3850,6 +3852,11 @@ mips_elf_sort_hash_table (bfd *abfd, struct bfd_link_info *info)
+     = hsd.min_got_dynindx
+     = (elf_hash_table (info)->dynsymcount - g->reloc_only_gotno);
+   hsd.max_non_got_dynindx = count_section_dynsyms (abfd, info) + 1;
++
++  mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *)
++                    elf_hash_table (info)),
++                    mips_elf_sort_hash_table_local_f,
++                    &hsd);
+   mips_elf_link_hash_traverse (((struct mips_elf_link_hash_table *)
+ 				elf_hash_table (info)),
+ 			       mips_elf_sort_hash_table_f,
+@@ -3879,28 +3886,40 @@ mips_elf_sort_hash_table_f (struct mips_elf_link_hash_entry *h, void *data)
+ {
+   struct mips_elf_hash_sort_data *hsd = data;
+ 
+-  /* Symbols without dynamic symbol table entries aren't interesting
+-     at all.  */
+-  if (h->root.dynindx == -1)
++  /* Only interested in global symbols with dynamic symbol table entries */
++  if (h->root.dynindx == -1 || h->root.forced_local)
+     return TRUE;
+ 
+-  switch (h->global_got_area)
+-    {
+-    case GGA_NONE:
++  if (h->global_got_area == GGA_NONE) {
+       h->root.dynindx = hsd->max_non_got_dynindx++;
+-      break;
++  } else {
++      if (h->global_got_area == GGA_NORMAL)
++          h->root.dynindx = --hsd->min_got_dynindx;
++      else
++          h->root.dynindx = hsd->max_unref_got_dynindx++;
+ 
+-    case GGA_NORMAL:
+-      h->root.dynindx = --hsd->min_got_dynindx;
+-      hsd->low = (struct elf_link_hash_entry *) h;
+-      break;
++      if (hsd->low == NULL || h->root.dynindx < hsd->low->dynindx)
++          hsd->low = (struct elf_link_hash_entry *) h;
++  }
+ 
+-    case GGA_RELOC_ONLY:
+-      if (hsd->max_unref_got_dynindx == hsd->min_got_dynindx)
+-	hsd->low = (struct elf_link_hash_entry *) h;
+-      h->root.dynindx = hsd->max_unref_got_dynindx++;
+-      break;
+-    }
++  return TRUE;
++}
++
++/* All local symbols must be appear before global symbols in the dynamic symbol
++   table so they're assigned indexs first. */
++
++static bfd_boolean
++mips_elf_sort_hash_table_local_f (struct mips_elf_link_hash_entry *h, void *data)
++{
++  struct mips_elf_hash_sort_data *hsd = data;
++
++  /* Only interested in local symbols with dynamic symbol table entries */
++  if (h->root.dynindx == -1 || !h->root.forced_local)
++    return TRUE;
++
++  h->root.dynindx = hsd->max_non_got_dynindx++;
++  if (h->global_got_area != GGA_NONE && hsd->low == NULL)
++      hsd->low = (struct elf_link_hash_entry *) h;
+ 
+   return TRUE;
+ }
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEd0YmQqnvlP0Pdxltupx4Bh3djJsFAlh5UXMACgkQupx4Bh3d
jJvPDw//ce7vjh7Rku/iIBREx8T8IntBzirvO/EmdHl8AekIRBtsEOgDB0gPoeJQ
nvxCXnhhzepdo2gTnHrcwd3cz7YB1y96l/rNZ3EK2uo9MFGKxcdjq/ybnFaBl+Ud
UUWIIIyX+l7K6AJRaXVuuIJQGC5AqZSFJEEouDrrpVOHI6ziS08OQkBDixIa6xAn
H27qOBX0oPuJjPSCdSGvhy7SxeJlmvlA9R59deZlNxqQJTlBpYx5bM3jV+5b6axA
cjTBxrAcsN1VqKAFocKb39SjH5/yGrLo4/C4CG7J5Tgj3+ZAMU1HyD7KV5Su2r3t
jWYxfPtvr44rL51ypIHKGkb5JX9CSlifpwbE7/HYKbNFwHzTt0SlIfs+bu075OxA
NGudEu/lYnaZUwaW250p0YlP20wvfpMQqEUB1iBPrGBHfxeuwEe74ipGCzY/dIPc
nA+Gt1yPRDs8FWGr0AeUj1D7PUCId8dtbpPe/A1qu4Tz+xfZabAKuS7SCFB2f2db
3isC8cB/Rbqyv+XUrffinYfWpWjkuEE91my5XuBb36J2Pm8o683mkMv8cmz0Hrku
UAU16pFctQ/QMVBzMKiKeLq9lbMZyDzVtd2PVztN1pBK3/gC1ERpb34ink4+STo0
YR94q9/Ri7XJDxQmRI3Wop97KVUTdq2r0+rGt1WVU07bM5yTdMk=
=DcpE
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.