This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: 32-bit PowerPC sdata linker problem
- From: Alan Modra <amodra at gmail dot com>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 18 Jun 2014 09:59:00 +0930
- Subject: Re: 32-bit PowerPC sdata linker problem
- Authentication-results: sourceware.org; auth=none
- References: <53918356 dot 3040102 at embedded-brains dot de> <20140606105420 dot GH5592 at bubble dot grove dot modra dot org> <5391A4BF dot 2030308 at embedded-brains dot de> <20140606121659 dot GJ5592 at bubble dot grove dot modra dot org> <20140607124711 dot GO5592 at bubble dot grove dot modra dot org> <CANu=Dmi46CDbvT3ozcjNJkyMY47Qh_TbgAgrAMPW1SpbeXX4mA at mail dot gmail dot com> <20140616130719 dot GK3462 at bubble dot grove dot modra dot org> <CANu=Dmi+4Hj=dxnBFeSGxs7unsKoqiFhVtuEt46Tr5poXBe3qQ at mail dot gmail dot com> <CANu=DmjAnLsxZ2sHN86xVxN5+2swirScH5iYDwfUrwRaZRN_bg at mail dot gmail dot com>
On Mon, Jun 16, 2014 at 03:11:12PM +0100, Will Newton wrote:
> On 16 June 2014 15:09, Will Newton <will.newton@linaro.org> wrote:
> > On 16 June 2014 14:07, Alan Modra <amodra@gmail.com> wrote:
> >> On Mon, Jun 16, 2014 at 12:21:23PM +0100, Will Newton wrote:
> >>> PROVIDE_HIDDEN (__rel_iplt_start = .);
> >>> *(.rel.iplt)
> >>> PROVIDE_HIDDEN (__rel_iplt_end = .);
> >>> PROVIDE_HIDDEN (__rela_iplt_start = .);
> >>> PROVIDE_HIDDEN (__rela_iplt_end = .);
> >>
> >> This should fix it. Committed.
> >>
> >> * scripttempl/elf.sc: Edit out __rela_iplt symbol assignments from
> >> .rel sections, and __rel_iplt from .rela sections.
> >> * scripttempl/nds32elf.sc: Likewise.
> >> * Makefile.am (ends32*.c) Depend on nds32elf.sc.
> >> * Makefile.in: Regenerate.
> >
> > Yes, this fixes the problem for me. Thanks!
>
> Would it be possible to apply the fix to the stable branch too?
Done. I'm also going to commit the following to 2.24.
PR 17047
* ldlang.c (lang_finish): Don't free linker hash table.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index ba7f493..9121aa2 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -1238,7 +1238,14 @@ lang_init (void)
void
lang_finish (void)
{
+ /* Some targets require access to the linker hash table during the
+ _bfd_write_contents call in bfd_close, so it can't be freed
+ before bfd_close. It can't be freed after bfd_close either,
+ since bfd_alloc memory holding side data structures disappears
+ (PR17047). So don't free it.
+
bfd_link_hash_table_free (link_info.output_bfd, link_info.hash);
+ */
bfd_hash_table_free (&lang_definedness_table);
output_section_statement_table_free ();
}
--
Alan Modra
Australia Development Lab, IBM