This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 2/4] [ARC] General bug fixes
- From: Nick Clifton <nickc at redhat dot com>
- To: Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Claudiu Zissulescu <Claudiu dot Zissulescu at synopsys dot com>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Mon, 13 Jun 2016 12:26:33 +0100
- Subject: Re: [PATCH 2/4] [ARC] General bug fixes
- Authentication-results: sourceware.org; auth=none
- References: <EB86EB452ADE4B44B294F7149B8A2777021DE520 at DE02WEMBXB dot internal dot synopsys dot com>
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