This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/4] [ARC] General bug fixes


Hi Nick,

I have made a mistake in previous patch.
I forgot to include the condition in the ASSERT itself. :-(

Here is a patch to apply over. Do you approve it?

Best regards,
Cupertino


bfd/ChangeLog:

Cupertino Miranda  <cmiranda@synospsy.com>

    elf32-arc.c (elf_arc_relocate_section): Fixed condition.


diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 38ca116..41d74e8 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1673,7 +1673,8 @@ elf_arc_relocate_section (bfd *             
output_bfd,
 
       /* Make sure we have with a dynamic linker.  In case of GOT and PLT
          the sym_section should point to .got or .plt respectively.  */
-      if (is_reloc_for_GOT (howto) || is_reloc_for_PLT (howto))
+      if ((is_reloc_for_GOT (howto) || is_reloc_for_PLT (howto))
+         && reloc_data.sym_section == NULL)
        {
          (*_bfd_error_handler)
            (_("GOT and PLT relocations cannot be fixed with a non
dynamic linker."));




On 06/13/2016 02:40 PM, Nick Clifton wrote:
> Hi Cupertino,
>
>> +      /* Make sure we have with a dynamic linker.  In case of GOT and PLT
>> +         the sym_section should point to .got or .plt respectively.  */
>> +      if (is_reloc_for_GOT (howto) || is_reloc_for_PLT (howto))
>> +    {
>> +      (*_bfd_error_handler)
>> +        (_("GOT and PLT relocations cannot be fixed with a non dynamic
>> linker."));
>> +      bfd_set_error (bfd_error_bad_value);
>> +      return FALSE;
>> +    }
>> +
>  
> Much better - thanks.
>
> Patch approved - please apply.
>
> Cheers
>   Nick
>
>

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 38ca116..41d74e8 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1673,7 +1673,8 @@ elf_arc_relocate_section (bfd *		   output_bfd,
 
       /* Make sure we have with a dynamic linker.  In case of GOT and PLT
          the sym_section should point to .got or .plt respectively.  */
-      if (is_reloc_for_GOT (howto) || is_reloc_for_PLT (howto))
+      if ((is_reloc_for_GOT (howto) || is_reloc_for_PLT (howto))
+	  && reloc_data.sym_section == NULL)
 	{
 	  (*_bfd_error_handler)
 	    (_("GOT and PLT relocations cannot be fixed with a non dynamic linker."));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]