[AArch64] Speed up linking speed by skipping unncessary TLS reloc type check

Jiong Wang jiong.wang@arm.com
Thu Aug 6 10:38:00 GMT 2015


Jiong Wang writes:

> When linking one application, perf shows "aarch64_can_relax_tls" consume
> about 5% CPU time, after a check, I found this function can be improved.
>
> It's invoked only in "aarch64_tls_transition", for normal applications
> which don't contain TLS relocations, the linker always need to go
> through the whole "or" check list.
>
> While at least, we can short the list by removing those TLS relocation
> types which don't need relaxation.  For example all TLS local executable
> relocation types shouldn't need any TLS relaxation in current
> implementation.
>
> For that application, This patch reduce the cpu consumed by
> aarch64_can_relax_tls from 5% to about 2.5%, and reduce the overall
> linking time of that application from 4.88s to 4.55s, linking is about
> 7% faster.
>
> OK for trunk?
>
> 2015-07-17  Jiong Wang  <jiong.wang@arm.com>
>
> bfd/
>   * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): New.
>   (aarch64_can_relax_tls): Use the new IS_AARCH64_TLS_RELAX_RELOC.

Ping~

BTW, IS_AARCH64_TLS_RELAX_RELOC is actually a copy of IS_AARCH64_TLS_RELOC
while we remove all those relocation types which don't need TLS
relaxation. So this patch should be safe to install.

-- 
Regards,
Jiong



More information about the Binutils mailing list