bfd: xtensa: fix PR ld/25630

Message ID 20200305045328.11298-1-jcmvbkbc@gmail.com
State New
Headers show
Series
  • bfd: xtensa: fix PR ld/25630
Related show

Commit Message

Max Filippov March 5, 2020, 4:53 a.m.
bfd/
2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>

	* elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
	relocation sections for any removed reference to a dynamic symbol.
---
 bfd/elf32-xtensa.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.20.1

Comments

augustine.sterling@gmail.com March 5, 2020, 5:35 p.m. | #1
On Wed, Mar 4, 2020 at 8:53 PM Max Filippov <jcmvbkbc@gmail.com> wrote:
>

> bfd/

> 2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>

>

>         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic

>         relocation sections for any removed reference to a dynamic symbol.


Looks good. Thanks for the fix.
Max Filippov March 6, 2020, 3:51 a.m. | #2
On Thu, Mar 5, 2020 at 9:36 AM augustine.sterling@gmail.com
<augustine.sterling@gmail.com> wrote:
>

> On Wed, Mar 4, 2020 at 8:53 PM Max Filippov <jcmvbkbc@gmail.com> wrote:

> >

> > bfd/

> > 2020-03-05  Max Filippov  <jcmvbkbc@gmail.com>

> >

> >         * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic

> >         relocation sections for any removed reference to a dynamic symbol.

>

> Looks good. Thanks for the fix.


Thanks. Applied to master.

-- Max

Patch

diff --git a/bfd/elf32-xtensa.c b/bfd/elf32-xtensa.c
index 12ff9f772aaf..65e14d87940c 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;