From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 22 00:14:55 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 072391065677 for ; Thu, 22 Jan 2009 00:14:55 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-gx0-f21.google.com (mail-gx0-f21.google.com [209.85.217.21]) by mx1.freebsd.org (Postfix) with ESMTP id 629B38FC26 for ; Thu, 22 Jan 2009 00:14:54 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: by gxk14 with SMTP id 14so4505283gxk.19 for ; Wed, 21 Jan 2009 16:14:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=olk6QACZgDkpKYs/okTwRqtmgvjQ8+E44r/xRCzsjFw=; b=iJPIbahHDAzHZMEwwuzJKSZRLdW3+3mMF3RRp9/vCjaUvYp3ZlF8i2PRgRv2z5Zc/h fD43hHrg3YD2WBBZHieSjaoXUGv3C8uQbi63VMRAfbHmA5BVUbuQS5NqVWJH7ua1T1Yh fwagrQ8RQAe4XKl7VEB5boFW3TF0EZO6XwaAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=qKHPqqZe7liImvR+YiTWDT6o/JNs0jKphLEdhgfUmpvQ5spA3fg1sqtZWhevYe+Jmr JeiMQRO4J5ketziCppOFysH9AwDDXRVlOz7nY7g3BWQReOygpuTiyvBjShiVfwXLasue 6fnh481Gl6ryohT2y01WVwgc7gvbfM7Rwuh1I= Received: by 10.150.219.16 with SMTP id r16mr496759ybg.17.1232581971922; Wed, 21 Jan 2009 15:52:51 -0800 (PST) Received: from kan.dnsalias.net (c-98-217-224-113.hsd1.ma.comcast.net [98.217.224.113]) by mx.google.com with ESMTPS id i52sm17112892rne.18.2009.01.21.15.52.50 (version=SSLv3 cipher=RC4-MD5); Wed, 21 Jan 2009 15:52:51 -0800 (PST) Date: Wed, 21 Jan 2009 18:52:45 -0500 From: Alexander Kabaev To: Dimitry Andric Message-ID: <20090121185245.00739316@kan.dnsalias.net> In-Reply-To: <4977B357.2080500@andric.com> References: <4977B357.2080500@andric.com> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.11; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/7TM59FX/r37fSNZHRWdH19J"; protocol="application/pgp-signature"; micalg=PGP-SHA1 Cc: freebsd-hackers@freebsd.org, Andrew Brampton 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: Thu, 22 Jan 2009 00:14:55 -0000 --Sig_/7TM59FX/r37fSNZHRWdH19J Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 22 Jan 2009 00:44:23 +0100 Dimitry Andric wrote: > 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. >=20 > This can (amongst others) occur if you assign structs, e.g.: >=20 > int test(void) > { > struct foo { > char bar[100]; > } a, b; >=20 > b =3D a; > } >=20 > Compile this with gcc -O0 -S, and you'll see it generates a call to > memcpy(). > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" =46rom GCC's info pages: Most of the compiler support routines used by GCC are present in `libgcc', but there are a few exceptions. GCC requires the freestanding environment provide `memcpy', `memmove', `memset' and `memcmp'.=20 We do not provide all necessary functions in kernel and mostly depend on luck for the kernel to link. Your luck apparently ran out :( --=20 Alexander Kabaev --Sig_/7TM59FX/r37fSNZHRWdH19J Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJd7VNQ6z1jMm+XZYRAk0pAKCZEn45WIWw1uGOJ7vxIrN/gNEA4wCgtlXb oMe7pMEfENFjjxujEjSUSQw= =MX+Y -----END PGP SIGNATURE----- --Sig_/7TM59FX/r37fSNZHRWdH19J--