This is the mail archive of the
mailing list for the binutils project.
Re: [SH] TLS IE -> LE optimization issue
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: thomas at codesourcery dot com
- Cc: binutils at sourceware dot org, aoliva at redhat dot com
- Date: Sat, 14 Apr 2012 08:16:13 +0900 (JST)
- Subject: Re: [SH] TLS IE -> LE optimization issue
- References: <email@example.com>
Thomas Schwinge <firstname.lastname@example.org> wrote:
> (This is also where the (dummy) SO comes into play: otherwise ,A;(Bdyn ==
> NULL,A+(B.) Back in sh_elf_size_dynamic_sections, ,A;(Bsrelgot->size != 0,A+(B
> (,A;(Bsizeof (Elf32_External_Rela) == 12,A+(B), thus memory for this section will
> be allocated (using bfd_zalloc). Later on, in sh_elf_relocate_section,
> the linker recognizes that TLS IE can here be optimized into TLS LE, and
> does so; the relocation slot is now not needed anymore (so
> srelgot->reloc_count is not incremented), but it is not reclaimed/the
> size reservation remains (and due to using zalloc, it's a R_SH_NONE), and
> thus the assertion is triggered.
> Expectedly, weakening the assertion into using <= instead of == makes the
> problem go away, but the empty slot in .rela.dyn remains (12 bytes
A weaken assertion would be enough. I'd like to pre-approve
such a change. The empty slots for this relatively rare case
would be not a big deal, I guess.