> From: Philip Guenther <guent...@gmail.com> > Date: Tue, 24 Apr 2018 21:09:32 +0200 > > On Tue, Apr 24, 2018 at 8:43 PM, Mark Kettenis <mark.kette...@xs4all.nl> > wrote: > > > So lld generates .gnu.hash sections that our ancient binutils doesn't > > grok. With the diff below (taken from FreeBSD's binutils, so GPLv2) > > fixes this. > > > > ok? > > > > --- gnu/usr.bin/binutils-2.17/bfd/elf.c 10 Aug 2016 20:46:08 -0000 > > 1.12 > > +++ gnu/usr.bin/binutils-2.17/bfd/elf.c 24 Apr 2018 18:41:12 -0000 > > > ... > > > @@ -2785,6 +2787,10 @@ elf_fake_sections (bfd *abfd, asection * > > case SHT_GROUP: > > this_hdr->sh_entsize = 4; > > break; > > + > > + case SHT_GNU_HASH: > > + this_hdr->sh_entsize = bed->s->arch_size == 64 ? 0 : 4; > > + break; > > > > The entity size is _zero_ for 64bit archs? (Or does that not really matter > because you're not trying to make it dump the actual hash table itself?)
Yes. The binaries produced by lld have it as 0 on amd64 and 4 on armv7, which matches the code I copied from FreeBSD. > Other than that possibly being wrong, ok guenther Thanks