x86: Treat protected symbols with indirect external access as local

If all external symbol accesses are indirect, we can treat protected
symbols as local since there will be no copy relocation for data and
external function pointer access will go through GOT, instead of PLT.
No PLT slot should be used for external function pointer in executable.

bfd/

	PR ld/33260
	* elfxx-x86.h (COPY_INPUT_RELOC_P): Treat protected symbols with
	indirect external access as local.

ld/

	PR ld/33260
	* testsuite/ld-i386/i386.exp: Run PR ld/33260 test.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr33260.d: New file.
	* testsuite/ld-i386/pr33260.s: Likewise.
	* testsuite/ld-x86-64/pr33260-x32.d: Likewise.
	* testsuite/ld-x86-64/pr33260.d: Likewise.
	* testsuite/ld-x86-64/pr33260.s: Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
8 files changed