Date: Sat, 21 Aug 2010 18:48:24 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r211585 - in stable/8/sys: boot/common kern Message-ID: <201008211848.o7LImOkb077966@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Aug 21 18:48:24 2010 New Revision: 211585 URL: http://svn.freebsd.org/changeset/base/211585 Log: MFC r210423: completely ignore zero-sized elf sections in modules of elf object type (amd64) Modified: stable/8/sys/boot/common/load_elf_obj.c stable/8/sys/kern/link_elf_obj.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/common/load_elf_obj.c ============================================================================== --- stable/8/sys/boot/common/load_elf_obj.c Sat Aug 21 18:40:42 2010 (r211584) +++ stable/8/sys/boot/common/load_elf_obj.c Sat Aug 21 18:48:24 2010 (r211585) @@ -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/8/sys/kern/link_elf_obj.c ============================================================================== --- stable/8/sys/kern/link_elf_obj.c Sat Aug 21 18:40:42 2010 (r211584) +++ stable/8/sys/kern/link_elf_obj.c Sat Aug 21 18:48:24 2010 (r211585) @@ -555,6 +555,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: @@ -677,6 +679,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: @@ -737,6 +741,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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008211848.o7LImOkb077966>