llvm-project/lld/test/pecoff/secrel.test
Rui Ueyama 30804c4220 [PECOFF] Fix SECREL relocations.
SECREL relocation's value is the offset to the beginning of the section.
Because of the off-by-one error, if a SECREL relocation target is at the
beginning of a section, it got wrong value.

Added a test that would have caught this.

llvm-svn: 221420
2014-11-06 01:03:23 +00:00

17 lines
675 B
Plaintext

# RUN: yaml2obj %p/Inputs/secrel1.obj.yaml > %t1.obj
# RUN: yaml2obj %p/Inputs/secrel2.obj.yaml > %t2.obj
# RUN: yaml2obj %p/Inputs/secrel2.obj.yaml > %t3.obj
#
# RUN: lld -flavor link /out:%t.exe /subsystem:console /entry:main \
# RUN: -- %t1.obj %t2.obj %t3.obj
# RUN: llvm-objdump -s %t.exe | FileCheck %s
CHECK: Contents of section .data:
CHECK: 1000 00000000 00000000 00000000 00000000
CHECK: 1010 10000000 00000000 00000000 00000000
CHECK: 1020 20000000 00000000 00000000 00000000
CHECK: Contents of section .data2:
CHECK: 2000 00000000 00000000 00000000 00000000
CHECK: 2010 10000000 00000000 00000000 00000000
CHECK: 2020 20000000 00000000 00000000 00000000