llvm-project/llvm/lib/Transforms/Instrumentation
Rafael Espindola 24a669d225 Prevent alias from pointing to weak aliases.
This adds back r204781.

Original message:

Aliases are just another name for a position in a file. As such, the
regular symbol resolutions are not applied. For example, given

define void @my_func() {
  ret void
}
@my_alias = alias weak void ()* @my_func
@my_alias2 = alias void ()* @my_alias

We produce without this patch:

        .weak   my_alias
my_alias = my_func
        .globl  my_alias2
my_alias2 = my_alias

That is, in the resulting ELF file my_alias, my_func and my_alias are
just 3 names pointing to offset 0 of .text. That is *not* the
semantics of IR linking. For example, linking in a

@my_alias = alias void ()* @other_func

would require the strong my_alias to override the weak one and
my_alias2 would end up pointing to other_func.

There is no way to represent that with aliases being just another
name, so the best solution seems to be to just disallow it, converting
a miscompile into an error.

llvm-svn: 204934
2014-03-27 15:26:56 +00:00
..
AddressSanitizer.cpp remove a bunch of unused private methods 2014-03-23 17:09:26 +00:00
BoundsChecking.cpp remove a bunch of unused private methods 2014-03-23 17:09:26 +00:00
CMakeLists.txt Remove lib/Transforms/Instrumentation/ProfilingUtils.* 2013-10-14 16:46:46 +00:00
DataFlowSanitizer.cpp Prevent alias from pointing to weak aliases. 2014-03-27 15:26:56 +00:00
DebugIR.cpp [C++11] Change DebugInfoFinder to use range-based loops 2014-03-18 09:41:07 +00:00
DebugIR.h Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
GCOVProfiling.cpp Cleanup whitespace 2014-03-11 02:44:45 +00:00
Instrumentation.cpp Re-sort all of the includes with ./utils/sort_includes.py so that 2014-01-07 11:48:04 +00:00
LLVMBuild.txt Add proper dependencies to LLVMBuild.txt in llvm/lib. 2013-12-10 05:39:34 +00:00
Makefile
MaximumSpanningTree.h Move all of the header files which are involved in modelling the LLVM IR 2013-01-02 11:36:10 +00:00
MemorySanitizer.cpp [msan] More precise instrumentation of select IR. 2014-03-25 13:08:34 +00:00
ThreadSanitizer.cpp IR: add a second ordering operand to cmpxhg for failure 2014-03-11 10:48:52 +00:00