From owner-svn-src-stable-7@FreeBSD.ORG Sat Aug 21 18:51:25 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DAE1065672; Sat, 21 Aug 2010 18:51:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A2C58FC1A; Sat, 21 Aug 2010 18:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIpPXf078079; Sat, 21 Aug 2010 18:51:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIpPaC078076; Sat, 21 Aug 2010 18:51:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201008211851.o7LIpPaC078076@svn.freebsd.org> From: Andriy Gapon Date: Sat, 21 Aug 2010 18:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211586 - in stable/7/sys: boot/common kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Aug 2010 18:51:25 -0000 Author: avg Date: Sat Aug 21 18:51:25 2010 New Revision: 211586 URL: http://svn.freebsd.org/changeset/base/211586 Log: MFC r210423: completely ignore zero-sized elf sections in modules of elf object type (amd64) Modified: stable/7/sys/boot/common/load_elf_obj.c stable/7/sys/kern/link_elf_obj.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/7/sys/boot/common/load_elf_obj.c Sat Aug 21 18:48:24 2010 (r211585) +++ stable/7/sys/boot/common/load_elf_obj.c Sat Aug 21 18:51:25 2010 (r211586) @@ -221,6 +221,8 @@ __elfN(obj_loadimage)(struct preloaded_f for (i = 0; i < hdr->e_shnum; i++) shdr[i].sh_addr = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_size == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: Modified: stable/7/sys/kern/link_elf_obj.c ============================================================================== --- stable/7/sys/kern/link_elf_obj.c Sat Aug 21 18:48:24 2010 (r211585) +++ stable/7/sys/kern/link_elf_obj.c Sat Aug 21 18:51:25 2010 (r211586) @@ -522,6 +522,8 @@ link_elf_load_file(linker_class_t cls, c symtabindex = -1; symstrindex = -1; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_size == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -644,6 +646,8 @@ link_elf_load_file(linker_class_t cls, c /* Size up code/data(progbits) and bss(nobits). */ alignmask = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_size == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: @@ -704,6 +708,8 @@ link_elf_load_file(linker_class_t cls, c ra = 0; alignmask = 0; for (i = 0; i < hdr->e_shnum; i++) { + if (shdr[i].sh_size == 0) + continue; switch (shdr[i].sh_type) { case SHT_PROGBITS: case SHT_NOBITS: