|
|
13ae24 |
diff -rup binutils.orig/bfd/elf.c binutils-2.30/bfd/elf.c
|
|
|
13ae24 |
--- binutils.orig/bfd/elf.c 2018-06-01 09:10:37.866552789 +0100
|
|
|
13ae24 |
+++ binutils-2.30/bfd/elf.c 2018-06-01 09:16:23.159605609 +0100
|
|
|
13ae24 |
@@ -707,11 +707,23 @@ setup_group (bfd *abfd, Elf_Internal_Shd
|
|
|
13ae24 |
|= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
|
|
|
13ae24 |
break;
|
|
|
13ae24 |
}
|
|
|
13ae24 |
- if (idx >= shnum)
|
|
|
13ae24 |
+ if (idx < shnum)
|
|
|
13ae24 |
+ {
|
|
|
13ae24 |
+ dest->shdr = elf_elfsections (abfd)[idx];
|
|
|
13ae24 |
+ /* PR binutils/23199: All sections in a
|
|
|
13ae24 |
+ section group should be marked with
|
|
|
13ae24 |
+ SHF_GROUP. But some tools generate
|
|
|
13ae24 |
+ broken objects without SHF_GROUP. Fix
|
|
|
13ae24 |
+ them up here. */
|
|
|
13ae24 |
+ dest->shdr->sh_flags |= SHF_GROUP;
|
|
|
13ae24 |
+ }
|
|
|
13ae24 |
+ if (idx >= shnum
|
|
|
13ae24 |
+ || dest->shdr->sh_type == SHT_GROUP)
|
|
|
13ae24 |
{
|
|
|
13ae24 |
_bfd_error_handler
|
|
|
13ae24 |
- (_("%B: invalid SHT_GROUP entry"), abfd);
|
|
|
13ae24 |
- idx = 0;
|
|
|
13ae24 |
+ (_("%B: invalid entry in SHT_GROUP section [%u]"),
|
|
|
13ae24 |
+ abfd, i);
|
|
|
13ae24 |
+ dest->shdr = NULL;
|
|
|
13ae24 |
}
|
|
|
13ae24 |
dest->shdr = elf_elfsections (abfd)[idx];
|
|
|
13ae24 |
}
|
|
|
13ae24 |
@@ -779,7 +791,8 @@ setup_group (bfd *abfd, Elf_Internal_Shd
|
|
|
13ae24 |
idx = (Elf_Internal_Group *) shdr->contents;
|
|
|
13ae24 |
n_elt = shdr->sh_size / 4;
|
|
|
13ae24 |
while (--n_elt != 0)
|
|
|
13ae24 |
- if ((s = (++idx)->shdr->bfd_section) != NULL
|
|
|
13ae24 |
+ if ((++idx)->shdr != NULL
|
|
|
13ae24 |
+ && (s = idx->shdr->bfd_section) != NULL
|
|
|
13ae24 |
&& elf_next_in_group (s) != NULL)
|
|
|
13ae24 |
break;
|
|
|
13ae24 |
if (n_elt != 0)
|
|
|
13ae24 |
diff -rup binutils.orig/bfd/elfxx-x86.c binutils-2.30/bfd/elfxx-x86.c
|
|
|
13ae24 |
--- binutils.orig/bfd/elfxx-x86.c 2018-06-01 09:10:37.854552926 +0100
|
|
|
13ae24 |
+++ binutils-2.30/bfd/elfxx-x86.c 2018-06-01 09:21:10.570323575 +0100
|
|
|
13ae24 |
@@ -1976,7 +1976,13 @@ _bfd_x86_elf_link_symbol_references_loca
|
|
|
13ae24 |
return TRUE;
|
|
|
13ae24 |
}
|
|
|
13ae24 |
|
|
|
13ae24 |
- eh->local_ref = 1;
|
|
|
13ae24 |
+ /* Symbols created by HIDDEN and PROVIDE_HIDDEN assignments in linker
|
|
|
13ae24 |
+ script aren't forced local here yet. bfd_hide_sym_by_version
|
|
|
13ae24 |
+ can't be used to check if a versioned symbol is hidden. It has to
|
|
|
13ae24 |
+ be syncd with _bfd_elf_link_assign_sym_version to get the correct
|
|
|
13ae24 |
+ answer. */
|
|
|
13ae24 |
+ if (!h->root.ldscript_def && h->versioned == unversioned)
|
|
|
13ae24 |
+ eh->local_ref = 1;
|
|
|
13ae24 |
return FALSE;
|
|
|
13ae24 |
}
|
|
|
13ae24 |
|