Mon Apr 9 13:00:07 2018 UTC ()
Pull up following revision(s) (requested by joerg in ticket #1543):

	external/gpl3/binutils/dist/bfd/elflink.c: revision 1.14 (patch)

When trying to decide the status of a weak symbol, resolve any
indirectness first. In the case of various Qt5 libraries, __bss_start
ends up with a Qt5 version, but it has to be resolved first to match the
actual (implicit) definition. This fixes the root cause of pkg/53089.


(martin)
diff -r1.5.2.1 -r1.5.2.2 src/external/gpl3/binutils/dist/bfd/elflink.c

cvs diff -r1.5.2.1 -r1.5.2.2 src/external/gpl3/binutils/dist/bfd/elflink.c (expand / switch to unified diff)

--- src/external/gpl3/binutils/dist/bfd/elflink.c 2012/04/03 15:54:48 1.5.2.1
+++ src/external/gpl3/binutils/dist/bfd/elflink.c 2018/04/09 13:00:06 1.5.2.2
@@ -2518,29 +2518,30 @@ _bfd_elf_fix_symbol_flags (struct elf_li @@ -2518,29 +2518,30 @@ _bfd_elf_fix_symbol_flags (struct elf_li
2518 } 2518 }
2519 2519
2520 /* If a weak undefined symbol has non-default visibility, we also 2520 /* If a weak undefined symbol has non-default visibility, we also
2521 hide it from the dynamic linker. */ 2521 hide it from the dynamic linker. */
2522 if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT 2522 if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
2523 && h->root.type == bfd_link_hash_undefweak) 2523 && h->root.type == bfd_link_hash_undefweak)
2524 (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE); 2524 (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE);
2525 2525
2526 /* If this is a weak defined symbol in a dynamic object, and we know 2526 /* If this is a weak defined symbol in a dynamic object, and we know
2527 the real definition in the dynamic object, copy interesting flags 2527 the real definition in the dynamic object, copy interesting flags
2528 over to the real definition. */ 2528 over to the real definition. */
2529 if (h->u.weakdef != NULL) 2529 if (h->u.weakdef != NULL)
2530 { 2530 {
2531 struct elf_link_hash_entry *weakdef; 2531 struct elf_link_hash_entry *weakdef = h->u.weakdef;
 2532 while (weakdef->root.type == bfd_link_hash_indirect)
 2533 weakdef = (struct elf_link_hash_entry *) weakdef->root.u.i.link;
2532 2534
2533 weakdef = h->u.weakdef; 
2534 if (h->root.type == bfd_link_hash_indirect) 2535 if (h->root.type == bfd_link_hash_indirect)
2535 h = (struct elf_link_hash_entry *) h->root.u.i.link; 2536 h = (struct elf_link_hash_entry *) h->root.u.i.link;
2536 2537
2537 BFD_ASSERT (h->root.type == bfd_link_hash_defined 2538 BFD_ASSERT (h->root.type == bfd_link_hash_defined
2538 || h->root.type == bfd_link_hash_defweak); 2539 || h->root.type == bfd_link_hash_defweak);
2539 BFD_ASSERT (weakdef->def_dynamic); 2540 BFD_ASSERT (weakdef->def_dynamic);
2540 2541
2541 /* If the real definition is defined by a regular object file, 2542 /* If the real definition is defined by a regular object file,
2542 don't do anything special. See the longer description in 2543 don't do anything special. See the longer description in
2543 _bfd_elf_adjust_dynamic_symbol, below. */ 2544 _bfd_elf_adjust_dynamic_symbol, below. */
2544 if (weakdef->def_regular) 2545 if (weakdef->def_regular)
2545 h->u.weakdef = NULL; 2546 h->u.weakdef = NULL;
2546 else 2547 else