llvm-6502/test/Linker
Peter Collingbourne bb660fc192 Prologue support
Patch by Ben Gamari!

This redefines the `prefix` attribute introduced previously and
introduces a `prologue` attribute.  There are a two primary usecases
that these attributes aim to serve,

  1. Function prologue sigils

  2. Function hot-patching: Enable the user to insert `nop` operations
     at the beginning of the function which can later be safely replaced
     with a call to some instrumentation facility

  3. Runtime metadata: Allow a compiler to insert data for use by the
     runtime during execution. GHC is one example of a compiler that
     needs this functionality for its tables-next-to-code functionality.

Previously `prefix` served cases (1) and (2) quite well by allowing the user
to introduce arbitrary data at the entrypoint but before the function
body. Case (3), however, was poorly handled by this approach as it
required that prefix data was valid executable code.

Here we redefine the notion of prefix data to instead be data which
occurs immediately before the function entrypoint (i.e. the symbol
address). Since prefix data now occurs before the function entrypoint,
there is no need for the data to be valid code.

The previous notion of prefix data now goes under the name "prologue
data" to emphasize its duality with the function epilogue.

The intention here is to handle cases (1) and (2) with prologue data and
case (3) with prefix data.

References
----------

This idea arose out of discussions[1] with Reid Kleckner in response to a
proposal to introduce the notion of symbol offsets to enable handling of
case (3).

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html

Test Plan: testsuite

Differential Revision: http://reviews.llvm.org/D6454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223189 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-03 02:08:38 +00:00
..
Inputs Add a test showing what the linker IdentifiedStructTypes is for. 2014-12-01 03:20:57 +00:00
2002-07-17-GlobalFail.ll
2002-07-17-LinkTest2.ll
2002-08-20-ConstantExpr.ll
2003-01-30-LinkerRename.ll Make this test a bit stricter. 2014-10-23 18:44:07 +00:00
2003-01-30-LinkerTypeRename.ll
2003-04-23-LinkOnceLost.ll
2003-04-26-NullPtrLinkProblem.ll
2003-05-15-TypeProblem.ll
2003-05-31-LinkerRename.ll Make this test a bit stricter. 2014-10-23 18:52:46 +00:00
2003-06-02-TypeResolveProblem2.ll
2003-06-02-TypeResolveProblem.ll
2003-08-20-OpaqueTypeResolve.ll
2003-08-23-GlobalVarLinking.ll
2003-08-23-RecursiveOpaqueTypeResolve.ll
2003-08-24-InheritPtrSize.ll
2003-08-28-TypeResolvesGlobal2.ll
2003-08-28-TypeResolvesGlobal3.ll
2003-08-28-TypeResolvesGlobal.ll
2003-10-27-LinkOncePromote.ll
2003-11-18-TypeResolution.ll
2004-02-17-WeakStrongLinkage.ll
2004-05-07-TypeResolution1.ll
2004-05-07-TypeResolution2.ll
2004-12-03-DisagreeingType.ll
2005-02-12-ConstantGlobals-2.ll
2005-02-12-ConstantGlobals.ll
2005-12-06-AppendingZeroLengthArrays.ll
2006-01-19-ConstantPacked.ll
2006-06-15-GlobalVarAlignment.ll
2008-03-05-AliasReference2.ll
2008-03-05-AliasReference.ll Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
2008-03-07-DroppedSection_a.ll
2008-03-07-DroppedSection_b.ll
2008-06-13-LinkOnceRedefinition.ll
2008-06-26-AddressSpace.ll
2008-07-06-AliasFnDecl2.ll
2008-07-06-AliasFnDecl.ll
2008-07-06-AliasWeakDest2.ll
2008-07-06-AliasWeakDest.ll
2009-09-03-mdnode2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2009-09-03-mdnode.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-04-DebugLoc2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-04-DebugLoc.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-04-Metadata2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-04-Metadata.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-18-unique-class-type2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-18-unique-class-type.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-18-unique-debug-type2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-18-unique-debug-type.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
2011-08-22-ResolveAlias2.ll Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
2011-08-22-ResolveAlias.ll Use "weak alias" instead of "alias weak" 2014-07-30 22:51:54 +00:00
alias.ll Allow alias to point to an arbitrary ConstantExpr. 2014-06-03 02:41:57 +00:00
AppendingLinkage2.ll
AppendingLinkage.ll
available_externally_a.ll
available_externally_b.ll
basiclink.ll
comdat2.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
comdat3.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
comdat4.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
comdat5.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
comdat6.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
comdat7.ll Cleanup this test a bit. 2014-10-23 19:36:21 +00:00
comdat8.ll Cleanup this test a bit. 2014-10-23 19:23:42 +00:00
comdat9.ll Set comdats when lazily linking functions. 2014-08-15 20:17:08 +00:00
comdat.ll IR: Add COMDATs to the IR 2014-06-27 18:19:56 +00:00
ConstantGlobals.ll merge tests for constant linking. 2014-10-31 05:04:16 +00:00
constructor-comdat.ll Fix use of uninitialized variable. 2014-08-11 17:07:34 +00:00
ctors.ll Fix pr20078. 2014-09-05 21:27:52 +00:00
datalayout.ll Don't assume an empty stderr. 2014-03-11 18:25:33 +00:00
DbgDeclare2.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
DbgDeclare.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
debug-info-version-a.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
debug-info-version-b.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
dllstorage-a.ll Copy dll storage in copyAttributes. 2014-02-13 05:11:35 +00:00
dllstorage-b.ll Copy dll storage in copyAttributes. 2014-02-13 05:11:35 +00:00
func-attrs-a.ll Verify that attributes are not lost during linking. 2014-01-24 19:20:15 +00:00
func-attrs-b.ll Verify that attributes are not lost during linking. 2014-01-24 19:20:15 +00:00
global_ctors.ll Don't upgrade global constructors when reading bitcode 2014-08-12 16:46:37 +00:00
ident.ll [Linker] Add some test coverage for llvm.ident merging 2014-11-05 21:33:34 +00:00
inlineasm.ll
link-global-to-func.ll
link-type-names.ll
linkage2.ll Merge alignment of common GlobalValue. 2014-09-09 17:48:18 +00:00
linkage.ll
linkmdnode2.ll
linkmdnode.ll
linknamedmdnode2.ll
linknamedmdnode.ll
LinkOnce.ll
lto-attributes.ll Copy externally_initialized in GlobalVariable::copyAttributesFrom. 2014-11-10 18:41:59 +00:00
metadata-a.ll
metadata-b.ll
module-flags-1-a.ll
module-flags-1-b.ll
module-flags-2-a.ll
module-flags-2-b.ll
module-flags-3-a.ll
module-flags-3-b.ll
module-flags-4-a.ll
module-flags-4-b.ll
module-flags-5-a.ll
module-flags-5-b.ll
module-flags-6-a.ll
module-flags-6-b.ll
module-flags-7-a.ll
module-flags-7-b.ll
module-flags-8-a.ll
module-flags-8-b.ll
module-flags-pic-1-a.ll Add Position-independent Code model Module API. 2014-11-07 04:46:10 +00:00
module-flags-pic-2-a.ll Add Position-independent Code model Module API. 2014-11-07 04:46:10 +00:00
multiple-merged-structs.ll
opaque.ll Add a testcase reduced from clang lto bootstrap on OS X. 2014-11-28 15:45:31 +00:00
partial-type-refinement-link.ll
partial-type-refinement.ll
PR8300.ll
prologuedata.ll Prologue support 2014-12-03 02:08:38 +00:00
redefinition.ll Unify and update link-messages.ll and redefinition.ll. NFC. 2014-10-31 16:52:30 +00:00
targettriple.ll Add a test for the -suppress-warnings option. 2014-10-25 01:14:15 +00:00
testlink.ll Pass the .ll files to llvm-link directly. NFC. 2014-11-24 20:35:59 +00:00
transitive-lazy-link.ll
type-unique-alias.ll Link the type of aliases. 2014-11-25 04:43:59 +00:00
type-unique-dst-types.ll Change how we keep track of which types are in the dest module. 2014-12-01 04:15:59 +00:00
type-unique-inheritance.ll
type-unique-name.ll Set the body of a new struct as soon as it is created. 2014-11-25 15:33:40 +00:00
type-unique-odr-a.ll [dwarfdump] Print the name for referenced specification of abstract_origin DIEs. 2014-10-06 03:36:31 +00:00
type-unique-odr-b.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-opaque.ll Add back r222727 with a fix. 2014-11-28 16:41:24 +00:00
type-unique-simple2-a.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-simple2-b.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-simple2.ll Reland r200340 - 'Add line table debug info to COFF files when using a win32 triple' 2014-01-30 01:39:17 +00:00
type-unique-simple-a.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-simple-b.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-src-type.ll Partial revert of r222986. 2014-12-01 16:32:20 +00:00
type-unique-type-array-a.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-type-array-b.ll Revert "Revert "DI: Fold constant arguments into a single MDString"" 2014-10-03 20:01:09 +00:00
type-unique-unrelated.ll Add an interesting test that we already get right. NFC. 2014-11-25 03:47:57 +00:00
unique-fwd-decl-a.ll IR: Simplify uniquing for MDNode 2014-11-17 23:28:21 +00:00
unnamed-addr1-a.ll Allow aliases to be unnamed_addr. 2014-06-06 01:20:28 +00:00
unnamed-addr1-b.ll Make this input file pass the verifier. 2014-09-09 15:40:12 +00:00
unnamed-addr-err-a.ll
unnamed-addr-err-b.ll
visibility.ll Revert r221096 bringing back r221014 with a fix. 2014-11-02 13:28:57 +00:00
weakextern.ll Pass the .ll files to llvm-link directly. NFC. 2014-11-24 20:35:59 +00:00