llvm-6502/test/MC/ELF
Rafael Espindola 0a70f9b3b9 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204294 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20 02:12:01 +00:00
..
abs.s
alias-reloc.s
alias.s Make the test harder by using a non-zero offset. 2014-03-19 00:26:58 +00:00
align-bss.s
align-nops.s
align-size.s
align-text.s
align.s
bad-expr.s
bad-relocation.s
bad-section.s
basic-elf-32.s
basic-elf-64.s
bracket-exprs.s
bracket.s
bss-large.ll
bss.ll
call-abs.s
cfi-adjust-cfa-offset.s
cfi-advance-loc2.s
cfi-def-cfa-offset.s
cfi-def-cfa-register.s
cfi-def-cfa.s
cfi-escape.s
cfi-offset.s
cfi-reg.s
cfi-register.s
cfi-rel-offset2.s
cfi-rel-offset.s
cfi-remember.s
cfi-restore.s
cfi-same-value.s
cfi-sections.s
cfi-signal-frame.s
cfi-undefined.s
cfi-window-save.s
cfi-zero-addr-delta.s
cfi.s
comdat-dup-group-name.s
comdat-reloc.s
comdat.s
common2.s
common.s
comp-dir.s
debug-line2.s
debug-line.s
debug-loc.s
diff2.s
diff.s
discriminator.s Support DWARF discriminators in object streamer. 2014-02-14 19:27:53 +00:00
dot-symbol-assignment.s Add support for assigning to . in AsmParser. 2014-02-17 20:48:32 +00:00
elf_directive_previous.s
elf_directive_section.s
empty-dwarf-lines.s
empty.s
entsize.ll
entsize.s
fde.s
file-double.s
file.s
gen-dwarf.s
global-offset.s
got.s
ident.s
ifunc-reloc.s
invalid-symver.s
lcomm.s
leb128.s
lit.local.cfg
local-reloc.s Fix broken CHECK lines 2014-02-16 07:31:05 +00:00
many-section.s
many-sections-2.s
merge.s
n_bytes.s
no-fixup.s
noexec.s
norelocation.s
org.s
pic-diff.s
plt.s
pr9292.s
relax-all-flag.s
relax-arith.s
relax-crash.s
relax.s
relocation-386.s
relocation-pc.s
relocation.s Look through variables when computing relocations. 2014-03-20 02:12:01 +00:00
rename.s
section-quoting.s
section.s
set.s
sleb.s
subsection.s
symbol-names.s
symref.s
tls-i386.s
tls.s
type.s
uleb.s
undef2.s
undef.s
version.s
weak-relocation.s
weak.s
weakref-plt.s
weakref-reloc.s
weakref.s
x86_64-reloc-sizetest.s
zero.s