x86-64: Fix calls via absolute function pointers
commitd79caa9ff6d42e11a8f21e9c22aefbfa4c25d7ed
authorMichael Matz <matz@suse.de>
Sun, 1 Jul 2018 23:54:45 +0000 (2 01:54 +0200)
committerMichael Matz <matz@suse.de>
Sun, 1 Jul 2018 23:57:29 +0000 (2 01:57 +0200)
tree65de2015b8d3affeaca8b92f4a2190206fa5ba48
parent65c7f19debb61f5b554c64a04ece92b951881282
x86-64: Fix calls via absolute function pointers

linkers don't treat relocations using symindex 0 (undefined)
very well, it can't be misused as indicator for an absolute number.
Just don't bother with special casing this, rather emit an indirect
call/jump right away. ARM64 needs the same (and didn't handle
calls via constant absolute func pointers before).

The testcase as is doesn't fail without the patch, it actually
needs separate compilation (to -fPIC .o file, then to shared lib)
to fail.
arm64-gen.c
tests/tests2/07_function.c
x86_64-gen.c