From: Jeremie Courreges-Anglas Subject: Re: ld.so/hppa: skip RELOC_NONE in the hppa fast path To: tech@openbsd.org Date: Fri, 6 Nov 2026 13:09:56 +0100 On Fri, Nov 06, 2026 at 10:48:44AM +0100, Kirill A. Korinsky wrote: > tech@, > > my quest with building gcc-16 at hppa allow me discvoer that BFD can include > RELOC_NONE in DT_RELACOUNT. > > Let skip them in the fast relocation loop, matching the normal loop, that > actually prevents a crash or how had I discovered this. It's a bit of a stretch to consider "no relocation" as a relative relocation, but what do I know... ok jca@ > Index: hppa/rtld_machine.c > =================================================================== > RCS file: /cvs/src/libexec/ld.so/hppa/rtld_machine.c,v > diff -u -p -r1.45 rtld_machine.c > --- hppa/rtld_machine.c 16 Jul 2026 11:21:37 -0000 1.45 > +++ hppa/rtld_machine.c 6 Nov 2026 09:44:28 -0000 > @@ -153,7 +153,11 @@ _dl_md_reloc(elf_object_t *object, int r > > /* tight loop for leading relative relocs */ > for (i = 0; i < num_relative; i++, rela++) { > - Elf_Addr *where = (Elf_Addr *)(rela->r_offset + loff); > + Elf_Addr *where; > + > + if (ELF_R_TYPE(rela->r_info) == RELOC_NONE) > + continue; > + where = (Elf_Addr *)(rela->r_offset + loff); > *where = rela->r_addend + loff; > } > for (; i < numrela; i++, rela++) { > > > -- > wbr, Kirill > -- jca