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

John David Anglin dave.anglin@bell.net
Sat Oct 18 00:28:06 GMT 2025


On 2025-10-17 2:55 p.m., Sven Schnelle wrote:
> Hi Dave,
> 
> John David Anglin <dave.anglin@bell.net> writes:
> 
>> 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.
> 
> I see a linux boot failure with this patch (addresses added for debugging):
> 
> Autobooting Linux kernel which was loaded by qemu...
> 
> Decompressing Linux... Bootcode overlaps kernel code (_startcode_end=0x150c000 kernel_addr=0x100000)done.
> Booting the kernel.
> <hangs here>
> QEMU: Terminated
> 
> I haven't investigated yet (busy with other stuff...), but it's easily
> reproducable with defconfig in linux + binutils master. It happens both
> on Hardware and qemu.

I believe this was fixed by commit c1288ad0f77bf2211dc33de30fe86dd084670a15.

Dave
-- 
John David Anglin  dave.anglin@bell.net


More information about the Binutils mailing list