x86-64: Use the GOT indirection in no-plt-check1.S
There is
cmpq %rax, func_p(%rip)
in no-plt-check1.S which requires copy relocation when func_p, a function
pointer, is defined in a shared library. Use the GOT indirection to
access func_p
movq func_p@GOTPCREL(%rip), %rdx
cmpq %rax, (%rdx)
to remove copy relocation to support PIE without copy relocation.
PR ld/33237
* testsuite/ld-x86-64/no-plt-check1.S: Use the GOT indirection
to access func_p.
* testsuite/ld-x86-64/no-plt-1a.dd: Adjusted.
* testsuite/ld-x86-64/no-plt-1b.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1a.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1b.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1c.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1d.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1e.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1f.dd: Likewise.
* testsuite/ld-x86-64/no-plt-1g.dd: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
8 files changed