[ELF][x86-64] Fix ifunc and add test.

In an previous commit I managed to completely disable the IRELATIVE relocation
writing code. I also used the wrong addend for the static relocation. Fix both
these issues and add a test. This test is quite brittle because there's no way
to do arithmetic on variables in FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@174161 91177308-0d34-0410-b5e6-96231b3b80d8