llvm-6502/lib/Transforms/Instrumentation
Rafael Espindola f165cf7ce8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204934 91177308-0d34-0410-b5e6-96231b3b80d8
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
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
LLVMBuild.txt
Makefile
MaximumSpanningTree.h
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