COFF: Fix SECREL and SECTION relocations.
authorRui Ueyama <ruiu@google.com>
Wed, 29 Jul 2015 16:30:45 +0000 (16:30 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 29 Jul 2015 16:30:45 +0000 (16:30 +0000)
commiteb26e1d03cf9117a102e8de215de31631dedb3d4
tree7f37eb568d17282e5b29a250bfe02dad4d9e981f
parentb4731a58475221c0dfe94fa87dfefa9d2af44347
COFF: Fix SECREL and SECTION relocations.

SECREL should sets the 32-bit offset of the target from the beginning
of *target's* output section. Previously, the offset from the beginning
of source's output section was used instead.

SECTION means the target section's index, and not the source section's
index. This patch fixes that issue too.

llvm-svn: 243535
lld/COFF/Chunks.cpp
lld/COFF/Chunks.h
lld/COFF/Symbols.h
lld/COFF/Writer.cpp
lld/test/COFF/reloc-x64.test
lld/test/COFF/reloc-x86.test