This is an archive of the discontinued LLVM Phabricator instance.

[PGO]: Eliminate __llvm_profile_register calls for Linux (compiler_rt)
ClosedPublic

Authored by davidxl on Sep 30 2015, 10:54 PM.

Details

Reviewers
davidxl
bogner
Summary

This is patch-3.

Diff Detail

Event Timeline

davidxl updated this revision to Diff 36189.Sep 30 2015, 10:54 PM
davidxl retitled this revision from to [PGO]: Eliminate __llvm_profile_register calls for Linux (compiler_rt).
davidxl updated this object.
davidxl added a reviewer: bogner.
davidxl added a subscriber: llvm-commits.
davidxl updated this revision to Diff 36276.Oct 1 2015, 11:14 AM

Conditionally define start/end symbols

davidxl updated this revision to Diff 36289.Oct 1 2015, 1:14 PM

Fixed linker script bug that broke gold linker

There is another solution that is similar to Darwin, so no linker script is needed. I will update the patch to go that route.

From Ian Taylor:

"When a section name is a valid C identifier, the linker automatically provides start and stop symbols set to the addresses of the beginning and end of the section. The symbols are start_SECNAME and stop_SECNAME where SECNAME is the name of the section.

This is not defined by the ELF ABI, but it is completely reliable on
GNU/Linux. In fact it is reliable on any ELF system except possibly
Solaris, and it probably works on Solaris too. This is definitely
what you should do instead of using a linker script. It's more
reliable and more efficient, and it's what everybody else does"

davidxl updated this revision to Diff 36319.Oct 1 2015, 3:48 PM

This is the latest version that does not rely on linker script.

davidxl updated this revision to Diff 36641.Oct 6 2015, 11:33 AM

Make new change strictly limited to linux platform.

vsk added a subscriber: vsk.Oct 6 2015, 11:43 AM
davidxl accepted this revision.Oct 13 2015, 12:06 PM
davidxl added a reviewer: davidxl.

The revision has been LGTM ed. Clang-formatted and committed upstream at r250200.

This revision is now accepted and ready to land.Oct 13 2015, 12:06 PM
davidxl closed this revision.Oct 13 2015, 12:08 PM