hppa64: Fix relocation handling for global data and a couple of thinkos

This fixes relocation handling in situations where hh->owner and
hh->sym_indx were not initialized.

2025-10-08  John David Anglin  <danglin@gcc.gnu.org>

bfd/ChangeLog:

	PR binutils/6511
	* elf64-hppa.c (global_sym_index): New from ia64.
	(elf64_hppa_check_relocs): Only set hh->eh.ref_regular if we
	have a regular definition.
	(elf64_hppa_check_relocs): Add missing NEED_DYNREL to need_entry
	assignment.
	(elf64_hppa_check_relocs): Stash symbol index and section
	earlier.
	(allocate_global_data_dlt): Initialize hh->owner and hh->sym_indx
	if not initialized.
	(allocate_global_data_opd): Likewise.  Remove redundant checks
	for NULL hh.
	(allocate_dynrel_entries): Check for discarded
	hppa_info->other_rel_sec section.  Add assert rent->sec->owner
	== hh->owner.
	(elf64_hppa_finalize_dynreloc): Check for discarded
	hppa_info->other_rel_sec section.
	(elf_hppa_final_link_relocate): Return bfd_reloc_ok if we
	have R_PARISC_NONE relocation.
1 file changed