From owner-cvs-all@FreeBSD.ORG Thu Oct 27 21:34:19 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 7A84E16A41F; Thu, 27 Oct 2005 21:34:19 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.FreeBSD.org (Postfix) with ESMTP id E500243D46; Thu, 27 Oct 2005 21:34:18 +0000 (GMT) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id AD62E2083; Thu, 27 Oct 2005 23:34:10 +0200 (CEST) X-Spam-Tests: ALL_TRUSTED,AWL,BAYES_00 X-Spam-Learn: ham X-Spam-Score: -4.4/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on tim.des.no Received: from xps.des.no (des.no [80.203.228.37]) by tim.des.no (Postfix) with ESMTP id 314562082; Thu, 27 Oct 2005 23:34:10 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id 1129433C1D; Thu, 27 Oct 2005 23:34:10 +0200 (CEST) To: Ruslan Ermilov References: <200510271424.j9REOkr8091913@repoman.freebsd.org> <20051027174042.GK68470@ip.net.ua> <864q723dqt.fsf@xps.des.no> <20051027204816.GX68470@ip.net.ua> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Thu, 27 Oct 2005 23:34:10 +0200 In-Reply-To: <20051027204816.GX68470@ip.net.ua> (Ruslan Ermilov's message of "Thu, 27 Oct 2005 23:48:16 +0300") Message-ID: <86vezi1w6l.fsf@xps.des.no> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: cvs-src@FreeBSD.org, "Bjoern A. Zeeb" , cvs-all@FreeBSD.org, src-committers@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 21:34:19 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable 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? Yes. AFAICT, it should select sections based on the presence of the SHF_ALLOC bit in sh_flags. See if the attached patch helps. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=link_elf_obj.diff Index: sys/kern/link_elf_obj.c =================================================================== RCS file: /home/ncvs/src/sys/kern/link_elf_obj.c,v retrieving revision 1.89 diff -u -r1.89 link_elf_obj.c --- sys/kern/link_elf_obj.c 28 Aug 2005 05:38:40 -0000 1.89 +++ sys/kern/link_elf_obj.c 27 Oct 2005 21:32:48 -0000 @@ -225,6 +225,8 @@ symtabindex = -1; symstrindex = -1; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_flags & SHF_ALLOC == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -295,6 +297,8 @@ rl = 0; ra = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_flags & SHF_ALLOC == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -496,6 +500,8 @@ symtabindex = -1; symstrindex = -1; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_flags & SHF_ALLOC == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -618,6 +624,8 @@ /* Size up code/data(progbits) and bss(nobits). */ alignmask = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_flags & SHF_ALLOC == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -671,6 +679,8 @@ ra = 0; alignmask = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_flags & SHF_ALLOC == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: --=-=-=--