From e15a8da9c71336b06cb5f2706c3f6b7e6ddd95a3 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Wed, 4 Mar 2020 14:54:27 -0800 Subject: [PATCH] bfd: xtensa: fix PR ld/25630 bfd/ 2020-03-05 Max Filippov * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic relocation sections for any removed reference to a dynamic symbol. --- bfd/ChangeLog | 5 +++++ bfd/elf32-xtensa.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1cfff1c04d7..838b07faf17 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-03-05 Max Filippov + + * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic + relocation sections for any removed reference to a dynamic symbol. + 2020-03-05 Nick Clifton * elf-bfd.h (struct elf_backend_data): Add new fields: diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c index 5e31e73a6fc..473a9d76f28 100644 --- a/bfd/elf32-xtensa.c +++ b/bfd/elf32-xtensa.c @@ -10148,10 +10148,9 @@ shrink_dynamic_reloc_sections (struct bfd_link_info *info, if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT) && (input_section->flags & SEC_ALLOC) != 0 - && (dynamic_symbol || bfd_link_pic (info)) - && (!h || h->root.type != bfd_link_hash_undefweak - || (dynamic_symbol - && (bfd_link_dll (info) || info->export_dynamic)))) + && (dynamic_symbol + || (bfd_link_pic (info) + && (!h || h->root.type != bfd_link_hash_undefweak)))) { asection *srel; bfd_boolean is_plt = FALSE; -- 2.30.2