| @@ -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 |