1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/lib
Rafael Espindola 9eed3f671f Look through variables when computing relocations.
Given

bar = foo + 4
	.long bar

MC would eat the 4. GNU as includes it in the relocation. The rule seems to be
that a variable that defines a symbol is used in the relocation and one that
does not define a symbol is evaluated and the result included in the relocation.

Fixing this unfortunately required some other changes:

* Since the variable is now evaluated, it would prevent the ELF writer from
  noticing the weakref marker the elf streamer uses. This patch then replaces
  that with a VariantKind in MCSymbolRefExpr.

* Using VariantKind then requires us to look past other VariantKind to see

	.weakref	bar,foo
	call	bar@PLT

  doing this also fixes

	zed = foo +2
	call zed@PLT

  so that is a good thing.

* Looking past VariantKind means that the relocation selection has to use
  the fixup instead of the target.

This is a reboot of the previous fixes for MC. I will watch the sanitizer
buildbot and wait for a build before adding back the previous fixes.

llvm-svn: 204294
2014-03-20 02:12:01 +00:00
..
Analysis Add stride normalization to SCEV Normalize/Denormalize transformation. 2014-03-18 17:34:03 +00:00
AsmParser Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
Bitcode Support: Make error_category's constructor public 2014-03-15 04:05:59 +00:00
CodeGen Revert "Use the range machinery for DW_AT_ranges and DW_AT_high/lo_pc." 2014-03-20 00:12:06 +00:00
DebugInfo Make some assertions on constant expressions static. 2014-03-15 18:47:07 +00:00
ExecutionEngine [C++11] Introduce SectionRef::relocations() to use range-based loops 2014-03-14 14:22:49 +00:00
IR Fix comment (PR19188) 2014-03-19 18:41:38 +00:00
IRReader Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
LineEditor [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
Linker [Layering] Sink Linker.h into a Linker subdirectory to make it 2014-03-06 03:42:23 +00:00
LTO Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
MC Look through variables when computing relocations. 2014-03-20 02:12:01 +00:00
Object Object: Provide a richer means of describing auxiliary symbols 2014-03-19 04:47:47 +00:00
Option Avoid buffer copies when a Twine already is a StringRef. 2013-12-03 18:18:28 +00:00
Support Support: add support to identify WinCOFF/ARM objects 2014-03-13 07:02:35 +00:00
TableGen Replace OwningPtr<T> with std::unique_ptr<T>. 2014-03-06 05:51:42 +00:00
Target Look through variables when computing relocations. 2014-03-20 02:12:01 +00:00
Transforms Set debug info for instructions inserted in SplitBlockAndInsertIfThen. 2014-03-19 12:56:38 +00:00
CMakeLists.txt Back out Profile library and dependent commits 2014-03-12 22:00:57 +00:00
LLVMBuild.txt Back out Profile library and dependent commits 2014-03-12 22:00:57 +00:00
Makefile Back out Profile library and dependent commits 2014-03-12 22:00:57 +00:00