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 Cupertino,

> bfd/ChangeLog:
> 
> Cupertino Miranda  <cmiranda@synospsy.com>
> 
>     elf32-arc.c (arc_local_data, arc_local_data): Removed.
>     (SECTSTART): Changed.
>     (elf_arc_relocate_section): Fixed mistake in PIE related condition.
>     (elf_arc_size_dynamic_sections): Changed DT_RELENT to DT_RELAENT.

Approved, please apply, but...

 
+      /* 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_ASSERT (reloc_data.sym_section != NULL);
+

I am not sure if an assertion is the right thing to use here.  Assertions
trigger aborts which IMHO should only happen if the *code* in the library
is broken.  If, on the other hand, the problem is because of a user error
eg - not supplying a dynamic linker - then the library should not abort,
but rather return an error value and set an error code.

So in this case I think that you would be better off calling bfd_error_handler()
and bfd_set_error() and then returning FALSE.

Cheers
  Nick


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