From owner-cvs-all@FreeBSD.ORG Thu Oct 27 22:09:10 2005 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39F0A16A41F; Thu, 27 Oct 2005 22:09:10 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55F5743D66; Thu, 27 Oct 2005 22:08:51 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j9RM7XsP039360; Fri, 28 Oct 2005 01:07:33 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 86472-04-2; Fri, 28 Oct 2005 01:07:30 +0300 (EEST) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id j9RM4ZJX039287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Oct 2005 01:04:35 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.4/8.13.4) id j9RM4c7Z058431; Fri, 28 Oct 2005 01:04:38 +0300 (EEST) (envelope-from ru) Date: Fri, 28 Oct 2005 01:04:37 +0300 From: Ruslan Ermilov To: Dag-Erling Sm?rgrav Message-ID: <20051027220437.GA54382@ip.net.ua> References: <200510271424.j9REOkr8091913@repoman.freebsd.org> <20051027174042.GK68470@ip.net.ua> <864q723dqt.fsf@xps.des.no> <20051027204816.GX68470@ip.net.ua> <86vezi1w6l.fsf@xps.des.no> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline In-Reply-To: <86vezi1w6l.fsf@xps.des.no> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at ip.net.ua Cc: cvs-src@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/conf kern.post.mk kmod.mk X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 22:09:10 -0000 --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 27, 2005 at 11:34:10PM +0200, Dag-Erling Sm?rgrav wrote: > Ruslan Ermilov writes: > > sys/kern/link_elf_obj.c is what's used with current format module > > objects on amd64. Can you see a problem there? >=20 > Yes. AFAICT, it should select sections based on the presence of the > SHF_ALLOC bit in sh_flags. See if the attached patch helps. >=20 Fantastic. :-) I was just about to test the following patch: %%% Index: link_elf_obj.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/kern/link_elf_obj.c,v retrieving revision 1.89 diff -u -p -r1.89 link_elf_obj.c --- link_elf_obj.c 28 Aug 2005 05:38:40 -0000 1.89 +++ link_elf_obj.c 27 Oct 2005 22:00:00 -0000 @@ -228,6 +228,8 @@ link_elf_link_preload(linker_class_t cls switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: + if (!(shdr[i].sh_flags & SHF_ALLOC)) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -298,6 +300,8 @@ link_elf_link_preload(linker_class_t cls switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: + if (!(shdr[i].sh_flags & SHF_ALLOC)) + break; ef->progtab[pb].addr =3D (void *)shdr[i].sh_addr; if (shdr[i].sh_type =3D=3D SHT_PROGBITS) ef->progtab[pb].name =3D "<>"; @@ -499,6 +503,8 @@ link_elf_load_file(linker_class_t cls, c switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: + if (!(shdr[i].sh_flags & SHF_ALLOC)) + break; ef->nprogtab++; break; case SHT_SYMTAB: @@ -621,6 +627,8 @@ link_elf_load_file(linker_class_t cls, c switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: + if (!(shdr[i].sh_flags & SHF_ALLOC)) + break; alignmask =3D shdr[i].sh_addralign - 1; mapsize +=3D alignmask; mapsize &=3D ~alignmask; @@ -674,6 +682,8 @@ link_elf_load_file(linker_class_t cls, c switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: + if (!(shdr[i].sh_flags & SHF_ALLOC)) + break; alignmask =3D shdr[i].sh_addralign - 1; mapbase +=3D alignmask; mapbase &=3D ~alignmask; %%% Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDYU71qRfpzJluFF4RAuPbAKCJPa7wUjR5G8u2dx9e7Tl+wyMx6QCfW1P7 f+kyBY+TVRZK7UKDrRQS/PA= =VG7j -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc--