This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] S/390: Fix two issues with the IFUNC optimized mem* routines


On 2012-09-02 07:50, H.J. Lu wrote:
> A relax pass won't work properly for x86 without some surgery
> since lang_relax_sections is called after bfd_elf_size_dynamic_sections
> which calls elf_x86_64_allocate_dynrelocs to allocate GOT entries
> and dynamic relocations. After it is done, it is not to easy to undo
> the damage.

Other targets keep usage counts of GOT entries live throughout relaxation.
It becomes easy to adjust the GOT *after* bfd_elf_size_dynamic_sections
has been called.  Indeed, many targets require this ordering since some
of the optimizations applied are true relaxations, and require knowledge
of true displacements.  And indeed, the reduction in GOT size may enable
another relaxation pass, enabling further optimizations to succeed.

> This is a separate issue.  X86 backends also optimize
> TLS relocations.  Some compilers generate bad TLS
> sequences which lead to corrupted output:
> 
> http://sourceware.org/bugzilla/show_bug.cgi?id=4928
> 
> But there is no way to turn off the TLS optimization.

... because it was done in the wrong place.  An excellent opportunity
to move the TLS relaxations to a relaxation pass, wouldn't you agree?


r~


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