elf: Prune empty generic properties

Prune empty generic properties before discarding empty property note
section and leave processor specific properties to the backend.

bfd/

	PR ld/33292
	* elf-properties.c (elf_prune_empty_properties): New function.
	(_bfd_elf_link_setup_gnu_properties): Call
	elf_prune_empty_properties before discarding empty property note
	section.  Move indirect_extern_access processing before
	elf_prune_empty_properties call.

ld/

	PR ld/33292
	* testsuite/ld-x86-64/pr33292-x32.d: New file.
	* testsuite/ld-x86-64/pr33292.d: Likewise.
	* testsuite/ld-x86-64/pr33292.s: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run PR ld/33292 tests.

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