From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 21 23:44:23 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 312C6106564A for ; Wed, 21 Jan 2009 23:44:23 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id E83BF8FC0A for ; Wed, 21 Jan 2009 23:44:22 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:1416:e549:1db8:acb8] (unknown [IPv6:2001:7b8:3a7:0:1416:e549:1db8:acb8]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 149E111F859; Thu, 22 Jan 2009 00:44:22 +0100 (CET) Message-ID: <4977B357.2080500@andric.com> Date: Thu, 22 Jan 2009 00:44:23 +0100 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1b3pre) Gecko/20090116 Shredder/3.0b2pre MIME-Version: 1.0 To: Andrew Brampton References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Kernel Module - GCC Requires memmove X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 23:44:23 -0000 On 2009-01-21 13:12, Andrew Brampton wrote: > The .ii file (post-processed source) did NOT mention memmove at all. > So I found it very odd that an undefined symbol existed in the object > file. So then I looked in the .s file (asm), and it was clearing > making a single call to memmove. This can (amongst others) occur if you assign structs, e.g.: int test(void) { struct foo { char bar[100]; } a, b; b = a; } Compile this with gcc -O0 -S, and you'll see it generates a call to memcpy().