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

Jiong Wang jiong.wang@arm.com
Fri Jul 17 12:11:00 GMT 2015


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.
  
-- 
Regards,
Jiong

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tls-check-speed-1.patch
Type: text/x-diff
Size: 1699 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150717/a7f68bfe/attachment.bin>


More information about the Binutils mailing list