This is the mail archive of the
mailing list for the binutils project.
Re: Nios2 dynobj handling fixes
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: Alan Modra <amodra at gmail dot com>, <binutils at sourceware dot org>
- Cc: Tristan Gingold <gingold at adacore dot com>, Andrew Jenner <andrew at codesourcery dot com>
- Date: Tue, 28 Feb 2017 00:38:03 -0700
- Subject: Re: Nios2 dynobj handling fixes
- Authentication-results: sourceware.org; auth=none
- References: <20170228024911.GG12547@bubble.grove.modra.org>
On 02/27/2017 07:49 PM, Alan Modra wrote:
A number of places in elf32-nios.c created dynamic sections but didn't
set the hash table dynobj. That meant we could have duplicate dynamic
sections connected to a number of bfds, so size_dynamic_sections
didn't properly discard or allocate contents. All sorts of havoc
Also, the entire set of dynamic sections was created in check_relocs
on seeing GOT relocs when only .got related sections are needed,
probably done to hide segfaults later in finish_dynamic_sections.
The patch fixes these issues and makes the assembler emit errors when
nios2 lacks the necessary pc-relative relocs for subtraction
expressions, rather than silently generating bad code. eg.
ld-elf/merge. I've also tidied uses of elf32_nios2_hash_table and
Thanks for helping out with this. This code has been hacked on by a lot
of people over the years and I'm starting to think the reason why it's
been so hard to understand is that it was broken. ;-) I really want to
apologize for not catching the breakage earlier, too -- I've been more
focused on GCC the past couple of months, and hadn't refreshed the
binutils checkout in my mainline nios2-linux-gnu build tree since
Anyway, I've verified that I get working executables again with this
patch, and I've kicked off some more thorough testing to run overnight.