R_X86_64_GOTPCREL is not relaxed if opcode is a 64-bit tail jmp.
foo.c
extern int foo();
int main() {
return foo();
}
$ clang -O2 -fno-plt -mrelax-relocations=yes foo.cc -c
$ objdump -dr foo.o
0000000000000000 <main>:
0: ff 25 00 00 00 00 jmpq *0x0(%rip) # 6 <main+0x6> 2: R_X86_64_GOTPCREL foo-0x4
Adding --save-temps to the above command-line will generate R_X86_64_GOTPCRELX
This is because in the former case, opcode is JMP64m but in the latter case it is a TAILJMPm64.