llvm-project/llvm/lib/CodeGen/AsmPrinter
Dean Michael Berris 0884b73220 [XRay][CodeGen] Use PIC-friendly code in XRay sleds; remove synthetic references in .text
Summary:
This change achieves two things:

  - Redefine the Custom Event handling instrumentation points emitted by
    the compiler to not require dynamic relocation of references to the
    __xray_CustomEvent trampoline.

  - Remove the synthetic reference we emit at the end of a function that
    we used to keep auxiliary sections alive in favour of SHF_LINK_ORDER
    associated with the section where the function is defined.

To achieve the custom event handling change, we've had to introduce the
concept of sled versioning -- this will need to be supported by the
runtime to allow us to understand how to turn on/off the new version of
the custom event handling sleds. That change has to land first before we
change the way we write the sleds.

To remove the synthetic reference, we rely on a relatively new linker
feature that preserves the sections that are associated with each other.
This allows us to limit the effects on the .text section of ELF
binaries.

Because we're still using absolute references that are resolved at
runtime for the instrumentation map (and function index) maps, we mark
these sections write-able. In the future we can re-define the entries in
the map to use relative relocations instead that can be statically
determined by the linker. That change will be a bit more invasive so we
defer this for later.

Depends on D36816.

Reviewers: dblaikie, echristo, pcc

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36615

llvm-svn: 311525
2017-08-23 04:49:41 +00:00
..
ARMException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
AddressPool.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
AddressPool.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
AsmPrinter.cpp [XRay][CodeGen] Use PIC-friendly code in XRay sleds; remove synthetic references in .text 2017-08-23 04:49:41 +00:00
AsmPrinterDwarf.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
AsmPrinterHandler.h Extract the method to begin and end a fragment in AsmPrinterHandler in their own method. NFC 2016-02-26 20:30:37 +00:00
AsmPrinterInlineAsm.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
ByteStreamer.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
CodeViewDebug.cpp [codeview] Emit nested enums and typedefs from classes 2017-08-08 20:30:14 +00:00
CodeViewDebug.h [codeview] Use the first valid source location at the top of every MBB 2017-06-30 21:33:44 +00:00
DIE.cpp Mark dump() methods as const. NFC 2017-06-21 22:19:17 +00:00
DIEHash.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DIEHash.h DebugInfo: Include .dwo file name when hashing multiple CUs in a single file 2017-05-29 06:32:34 +00:00
DIEHashAttributes.def Fix DIEHash refactoring that dropped the DW_AT_name from the hash 2017-05-23 18:36:07 +00:00
DbgValueHistoryCalculator.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DbgValueHistoryCalculator.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DebugHandlerBase.cpp Make helper functions static. NFC. 2017-05-26 20:09:00 +00:00
DebugHandlerBase.h Refactor DebugHandlerBase a bit to common non-debug-having-function filtering 2017-02-16 18:48:33 +00:00
DebugLocEntry.h Remove unreachable code. (NFC) 2017-08-02 15:22:17 +00:00
DebugLocStream.cpp
DebugLocStream.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DwarfAccelTable.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfAccelTable.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfCFIException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
DwarfCompileUnit.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfCompileUnit.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfDebug.cpp Filter out non-constant DIGlobalVariableExpressions reachable via the CU 2017-08-19 01:15:06 +00:00
DwarfDebug.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfException.h Emit .cfi_sections before the first .cfi_startproc 2017-01-02 18:05:27 +00:00
DwarfExpression.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfExpression.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfFile.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfFile.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfStringPool.cpp [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfStringPool.h [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-08-17 21:26:39 +00:00
DwarfUnit.cpp Remove unreachable code. (NFC) 2017-08-02 15:22:17 +00:00
DwarfUnit.h [DWARF] Move a couple of member functions to the DWARFUnit baseclass. NFC. 2017-06-30 00:27:45 +00:00
EHStreamer.cpp [EH] Fix the LSDA that we emit for unknown EH personalities 2017-05-31 22:18:49 +00:00
EHStreamer.h Extract the method to begin and end a fragment in AsmPrinterHandler in their own method. NFC 2016-02-26 20:30:37 +00:00
ErlangGCPrinter.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
LLVMBuild.txt Update libdeps to add BinaryFormat, introduced in r304864. 2017-06-07 04:48:49 +00:00
OcamlGCPrinter.cpp [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
WinException.cpp Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
WinException.h [WinEH] Don't assume endFunction is called while in .text 2016-12-28 19:05:12 +00:00