From bbaddd4bbeba65200ee805d87c2e3a845842e3eb Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 24 Feb 2021 18:01:16 +1030 Subject: PR27441, inconsistency in weak definitions This makes IR objects use the same logic as normal objects with respect to what sort of ref/def makes an as-needed library needed. Testing the binding of the definition is just plain wrong. What matters is the binding of the reference. PR 27441 * elf-bfd.h (struct elf_link_hash_entry): Add ref_ir_nonweak. * elflink.c (elf_link_add_object_symbols): Set ref_ir_nonweak and use when deciding an as-needed library should be loaded instead of using the binding of the library definition. --- bfd/elf-bfd.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bfd/elf-bfd.h') diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index 4b79ee8..dd66d98 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -184,6 +184,8 @@ struct elf_link_hash_entry /* Symbol has a non-weak reference from a non-shared object (other than the object in which it is defined). */ unsigned int ref_regular_nonweak : 1; + /* Symbol has a non-weak reference from a LTO IR object file. */ + unsigned int ref_ir_nonweak : 1; /* Dynamic symbol has been adjustd. */ unsigned int dynamic_adjusted : 1; /* Symbol needs a copy reloc. */ -- cgit v1.1