Another correction for plugin as-needed patch. (#1889763)
This commit is contained in:
parent
611c7aa70b
commit
a4573e9c3e
@ -1,80 +1,54 @@
|
|||||||
diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
--- binutils.orig/bfd/elflink.c 2020-11-03 11:59:59.966565009 +0000
|
||||||
--- binutils.orig/bfd/elflink.c 2020-10-29 12:46:32.228618844 +0000
|
+++ binutils-2.35.1/bfd/elflink.c 2020-11-03 12:07:34.691991602 +0000
|
||||||
+++ binutils-2.35.1/bfd/elflink.c 2020-10-29 13:07:58.786847312 +0000
|
@@ -4477,7 +4477,12 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
@@ -5340,7 +5340,7 @@ elf_link_add_object_symbols (bfd *abfd,
|
|
||||||
struct elf_link_hash_entry *h;
|
|
||||||
bfd_size_type size;
|
|
||||||
unsigned int alignment_power;
|
|
||||||
- unsigned int non_ir_ref_dynamic;
|
|
||||||
+ struct elf_link_hash_entry preserved_h;
|
|
||||||
|
|
||||||
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
|
||||||
{
|
|
||||||
@@ -5365,7 +5365,8 @@ elf_link_add_object_symbols (bfd *abfd,
|
|
||||||
/* Preserve non_ir_ref_dynamic so that this symbol
|
|
||||||
will be exported when the dynamic lib becomes needed
|
|
||||||
in the second pass. */
|
|
||||||
- non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
|
|
||||||
+ preserved_h = *h;
|
|
||||||
+
|
|
||||||
memcpy (p, old_ent, htab->root.table.entsize);
|
|
||||||
old_ent = (char *) old_ent + htab->root.table.entsize;
|
|
||||||
h = (struct elf_link_hash_entry *) p;
|
h = (struct elf_link_hash_entry *) p;
|
||||||
@@ -5382,7 +5383,10 @@ elf_link_add_object_symbols (bfd *abfd,
|
entsize += htab->root.table.entsize;
|
||||||
if (alignment_power > h->root.u.c.p->alignment_power)
|
if (h->root.type == bfd_link_hash_warning)
|
||||||
h->root.u.c.p->alignment_power = alignment_power;
|
- entsize += htab->root.table.entsize;
|
||||||
}
|
+ {
|
||||||
- h->root.non_ir_ref_dynamic = non_ir_ref_dynamic;
|
+ entsize += htab->root.table.entsize;
|
||||||
+
|
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||||
+ h->root.non_ir_ref_dynamic
|
+ }
|
||||||
+ = preserved_h.root.non_ir_ref_dynamic;
|
+ if (h->root.type == bfd_link_hash_common)
|
||||||
+ h->root.as_needed_def_dynamic |= preserved_h.dynamic_def;
|
+ entsize += sizeof (*h->root.u.c.p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5819,6 +5823,11 @@ elf_link_add_archive_symbols (bfd *abfd,
|
@@ -4521,14 +4526,20 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
if (h == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
+ /* Don't load the archive element after seeing a definition
|
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
||||||
+ in a DT_NEEDED shared object. */
|
|
||||||
+ if (h->root.as_needed_def_dynamic)
|
|
||||||
+ continue;
|
|
||||||
+
|
|
||||||
if (h->root.type == bfd_link_hash_undefined)
|
|
||||||
{
|
{
|
||||||
/* If the archive element has already been loaded then one
|
- memcpy (old_ent, p, htab->root.table.entsize);
|
||||||
Only in binutils.orig/: binutils-2.35.1
|
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||||
diff -rup binutils.orig/include/bfdlink.h binutils-2.35.1/include/bfdlink.h
|
h = (struct elf_link_hash_entry *) p;
|
||||||
--- binutils.orig/include/bfdlink.h 2020-10-29 12:46:31.611621137 +0000
|
+ memcpy (old_ent, h, htab->root.table.entsize);
|
||||||
+++ binutils-2.35.1/include/bfdlink.h 2020-10-29 13:07:36.833927443 +0000
|
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||||
@@ -114,6 +114,9 @@ struct bfd_link_hash_entry
|
if (h->root.type == bfd_link_hash_warning)
|
||||||
as distinct from a LTO IR object file. */
|
{
|
||||||
unsigned int non_ir_ref_dynamic : 1;
|
- memcpy (old_ent, h->root.u.i.link, htab->root.table.entsize);
|
||||||
|
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||||
+ /* Symbol is defined in a DT_NEEDED dynamic object file. */
|
+ memcpy (old_ent, h, htab->root.table.entsize);
|
||||||
+ unsigned int as_needed_def_dynamic : 1;
|
old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||||
+
|
}
|
||||||
/* Symbol is a built-in define. These will be overridden by PROVIDE
|
+ if (h->root.type == bfd_link_hash_common)
|
||||||
in a linker script. */
|
+ {
|
||||||
unsigned int linker_def : 1;
|
+ memcpy (old_ent, h->root.u.c.p, sizeof (*h->root.u.c.p));
|
||||||
diff -rup binutils.orig/ld/plugin.c binutils-2.35.1/ld/plugin.c
|
+ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p);
|
||||||
--- binutils.orig/ld/plugin.c 2020-10-29 12:46:31.878620145 +0000
|
+ }
|
||||||
+++ binutils-2.35.1/ld/plugin.c 2020-10-29 13:07:19.951989072 +0000
|
}
|
||||||
@@ -794,7 +794,8 @@ get_symbols (const void *handle, int nsy
|
|
||||||
if (blhe->type == bfd_link_hash_undefined
|
|
||||||
|| blhe->type == bfd_link_hash_undefweak)
|
|
||||||
{
|
|
||||||
- res = LDPR_UNDEF;
|
|
||||||
+ res = (blhe->as_needed_def_dynamic
|
|
||||||
+ ? LDPR_RESOLVED_DYN : LDPR_UNDEF);
|
|
||||||
goto report_symbol;
|
|
||||||
}
|
}
|
||||||
if (blhe->type != bfd_link_hash_defined
|
}
|
||||||
diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
@@ -4899,7 +4910,8 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
--- binutils.orig/bfd/elflink.c 2020-10-30 10:31:04.291893073 +0000
|
}
|
||||||
+++ binutils-2.35.1/bfd/elflink.c 2020-10-30 10:48:43.793863465 +0000
|
|
||||||
@@ -4970,11 +4970,10 @@ elf_link_add_object_symbols (bfd *abfd,
|
if (! (_bfd_generic_link_add_one_symbol
|
||||||
|
- (info, abfd, name, flags, sec, value, NULL, FALSE, bed->collect,
|
||||||
|
+ (info, abfd, name, flags, sec, value,
|
||||||
|
+ NULL, FALSE, bed->collect,
|
||||||
|
(struct bfd_link_hash_entry **) sym_hash)))
|
||||||
|
goto error_free_vers;
|
||||||
|
|
||||||
|
@@ -4970,11 +4982,10 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
object and a shared object. */
|
object and a shared object. */
|
||||||
bfd_boolean dynsym = FALSE;
|
bfd_boolean dynsym = FALSE;
|
||||||
|
|
||||||
@ -88,7 +62,7 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
{
|
{
|
||||||
if (! definition)
|
if (! definition)
|
||||||
{
|
{
|
||||||
@@ -4991,14 +4990,6 @@ elf_link_add_object_symbols (bfd *abfd,
|
@@ -4991,14 +5002,6 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
h->ref_dynamic = 1;
|
h->ref_dynamic = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,7 +77,7 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -5012,14 +5003,25 @@ elf_link_add_object_symbols (bfd *abfd,
|
@@ -5012,14 +5015,25 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
h->def_dynamic = 1;
|
h->def_dynamic = 1;
|
||||||
hi->def_dynamic = 1;
|
hi->def_dynamic = 1;
|
||||||
}
|
}
|
||||||
@ -136,7 +110,7 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
dynsym = TRUE;
|
dynsym = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5214,6 +5216,9 @@ elf_link_add_object_symbols (bfd *abfd,
|
@@ -5214,6 +5228,9 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
&& definition
|
&& definition
|
||||||
&& ((dynsym
|
&& ((dynsym
|
||||||
&& h->ref_regular_nonweak)
|
&& h->ref_regular_nonweak)
|
||||||
@ -146,14 +120,13 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
|| (h->ref_dynamic_nonweak
|
|| (h->ref_dynamic_nonweak
|
||||||
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
|
&& (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0
|
||||||
&& !on_needed_list (elf_dt_name (abfd),
|
&& !on_needed_list (elf_dt_name (abfd),
|
||||||
@@ -5338,55 +5343,33 @@ elf_link_add_object_symbols (bfd *abfd,
|
@@ -5338,49 +5355,31 @@ elf_link_add_object_symbols (bfd *abfd,
|
||||||
{
|
{
|
||||||
struct bfd_hash_entry *p;
|
struct bfd_hash_entry *p;
|
||||||
struct elf_link_hash_entry *h;
|
struct elf_link_hash_entry *h;
|
||||||
- bfd_size_type size;
|
- bfd_size_type size;
|
||||||
- unsigned int alignment_power;
|
- unsigned int alignment_power;
|
||||||
- struct elf_link_hash_entry preserved_h;
|
unsigned int non_ir_ref_dynamic;
|
||||||
+ unsigned int non_ir_ref_dynamic;
|
|
||||||
|
|
||||||
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
for (p = htab->root.table.table[i]; p != NULL; p = p->next)
|
||||||
{
|
{
|
||||||
@ -178,14 +151,13 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
/* Preserve non_ir_ref_dynamic so that this symbol
|
/* Preserve non_ir_ref_dynamic so that this symbol
|
||||||
will be exported when the dynamic lib becomes needed
|
will be exported when the dynamic lib becomes needed
|
||||||
in the second pass. */
|
in the second pass. */
|
||||||
- preserved_h = *h;
|
|
||||||
+ h = (struct elf_link_hash_entry *) p;
|
+ h = (struct elf_link_hash_entry *) p;
|
||||||
+ if (h->root.type == bfd_link_hash_warning)
|
+ if (h->root.type == bfd_link_hash_warning)
|
||||||
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
+ h = (struct elf_link_hash_entry *) h->root.u.i.link;
|
||||||
+ non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
|
non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
|
||||||
|
|
||||||
- memcpy (p, old_ent, htab->root.table.entsize);
|
- memcpy (p, old_ent, htab->root.table.entsize);
|
||||||
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
- old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||||
|
+
|
||||||
h = (struct elf_link_hash_entry *) p;
|
h = (struct elf_link_hash_entry *) p;
|
||||||
+ memcpy (h, old_ent, htab->root.table.entsize);
|
+ memcpy (h, old_ent, htab->root.table.entsize);
|
||||||
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
+ old_ent = (char *) old_ent + htab->root.table.entsize;
|
||||||
@ -206,49 +178,5 @@ diff -rup binutils.orig/bfd/elflink.c binutils-2.35.1/bfd/elflink.c
|
|||||||
+ memcpy (h->root.u.c.p, old_ent, sizeof (*h->root.u.c.p));
|
+ memcpy (h->root.u.c.p, old_ent, sizeof (*h->root.u.c.p));
|
||||||
+ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p);
|
+ old_ent = (char *) old_ent + sizeof (*h->root.u.c.p);
|
||||||
}
|
}
|
||||||
-
|
h->root.non_ir_ref_dynamic = non_ir_ref_dynamic;
|
||||||
- h->root.non_ir_ref_dynamic
|
|
||||||
- = preserved_h.root.non_ir_ref_dynamic;
|
|
||||||
- h->root.as_needed_def_dynamic |= preserved_h.dynamic_def;
|
|
||||||
+ h->root.non_ir_ref_dynamic = non_ir_ref_dynamic;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@@ -5823,11 +5806,6 @@ elf_link_add_archive_symbols (bfd *abfd,
|
|
||||||
if (h == NULL)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
- /* Don't load the archive element after seeing a definition
|
|
||||||
- in a DT_NEEDED shared object. */
|
|
||||||
- if (h->root.as_needed_def_dynamic)
|
|
||||||
- continue;
|
|
||||||
-
|
|
||||||
if (h->root.type == bfd_link_hash_undefined)
|
|
||||||
{
|
|
||||||
/* If the archive element has already been loaded then one
|
|
||||||
diff -rup binutils.orig/include/bfdlink.h binutils-2.35.1/include/bfdlink.h
|
|
||||||
--- binutils.orig/include/bfdlink.h 2020-10-30 10:31:03.269895974 +0000
|
|
||||||
+++ binutils-2.35.1/include/bfdlink.h 2020-10-30 10:47:03.087152957 +0000
|
|
||||||
@@ -114,9 +114,6 @@ struct bfd_link_hash_entry
|
|
||||||
as distinct from a LTO IR object file. */
|
|
||||||
unsigned int non_ir_ref_dynamic : 1;
|
|
||||||
|
|
||||||
- /* Symbol is defined in a DT_NEEDED dynamic object file. */
|
|
||||||
- unsigned int as_needed_def_dynamic : 1;
|
|
||||||
-
|
|
||||||
/* Symbol is a built-in define. These will be overridden by PROVIDE
|
|
||||||
in a linker script. */
|
|
||||||
unsigned int linker_def : 1;
|
|
||||||
diff -rup binutils.orig/ld/plugin.c binutils-2.35.1/ld/plugin.c
|
|
||||||
--- binutils.orig/ld/plugin.c 2020-10-30 10:31:03.357895725 +0000
|
|
||||||
+++ binutils-2.35.1/ld/plugin.c 2020-10-30 10:47:23.905093110 +0000
|
|
||||||
@@ -794,8 +794,7 @@ get_symbols (const void *handle, int nsy
|
|
||||||
if (blhe->type == bfd_link_hash_undefined
|
|
||||||
|| blhe->type == bfd_link_hash_undefweak)
|
|
||||||
{
|
|
||||||
- res = (blhe->as_needed_def_dynamic
|
|
||||||
- ? LDPR_RESOLVED_DYN : LDPR_UNDEF);
|
|
||||||
+ res = LDPR_UNDEF;
|
|
||||||
goto report_symbol;
|
|
||||||
}
|
|
||||||
if (blhe->type != bfd_link_hash_defined
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Summary: A GNU collection of binary utilities
|
Summary: A GNU collection of binary utilities
|
||||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||||
Version: 2.35.1
|
Version: 2.35.1
|
||||||
Release: 11%{?dist}
|
Release: 12%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
URL: https://sourceware.org/binutils
|
URL: https://sourceware.org/binutils
|
||||||
|
|
||||||
@ -77,6 +77,9 @@ URL: https://sourceware.org/binutils
|
|||||||
# Default: support debuginfod.
|
# Default: support debuginfod.
|
||||||
%bcond_without debuginfod
|
%bcond_without debuginfod
|
||||||
|
|
||||||
|
# Use the system supplied version of the zlib compress library.
|
||||||
|
# Change this to use the binutils builtin version instead.
|
||||||
|
%bcond_without systemzlib
|
||||||
|
|
||||||
%if %{with bootstrap}
|
%if %{with bootstrap}
|
||||||
%undefine with_docs
|
%undefine with_docs
|
||||||
@ -542,6 +545,9 @@ popd
|
|||||||
--with-sysroot=%{_prefix}/%{binutils_target}/sys-root \
|
--with-sysroot=%{_prefix}/%{binutils_target}/sys-root \
|
||||||
--program-prefix=%{cross} \
|
--program-prefix=%{cross} \
|
||||||
%endif
|
%endif
|
||||||
|
%if %{with systemzlib}
|
||||||
|
--with-system-zlib \
|
||||||
|
%endif
|
||||||
%if %{enable_shared}
|
%if %{enable_shared}
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
%else
|
%else
|
||||||
@ -832,6 +838,9 @@ exit 0
|
|||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 03 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-12
|
||||||
|
- Another correction for plugin as-needed patch. (#1889763)
|
||||||
|
|
||||||
* Wed Oct 28 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-11
|
* Wed Oct 28 2020 Nick Clifton <nickc@redhat.com> - 2.35.1-11
|
||||||
- Correction for plugin as-needed patch. (#1889763)
|
- Correction for plugin as-needed patch. (#1889763)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user