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: [SH] TLS IE -> LE optimization issue


Thomas Schwinge <thomas@codesourcery.com> 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
> wasted).

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.

Regards,
	kaz


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