[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Build errors with fuzz/x86_instruction_emulator harness


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Aug 2023 18:04:00 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8BBVelKimRRMdQ8LroyMFV401PUeug8LMS7ukMvyyqw=; b=b9Xqxgilw8kh/qbpPY/KXsNOHAAvlThY3xjMYmenGPgficwFr1OiBjGUZIGp4lShJSHzIvQuCwc3vQS6QoPNUfLmeeEZar3OGN6qqUTKRbPMhOs5j8w9dn4jRSlWk15p03uaVjekbv1wWjFgDKiM3aopLnGtThCK3J9+ddisCEx6tlkis7ylZt6PSMwaUyNvTduaAww4xy2gftpuHtGoI/kqZNmzpZazdkWHgseti1emF2KNxXDPisdsKwMIFQlfWXvgStHJ4kL9WIPAvEQI3Q/mkG8yBwmTz2YXHUng25JbGvGAChLOA7NnslGJErB/EL2u8u8o7ykC1ZMtrPsEqg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RndI78nORcTtcFA8hEXu2XJlAoaMSRdzpweLh1er5zSBUZS9vwnI3mb33VQG8aRBvff6fitH92C3SmXaNPz7cTrVJP1PY/05ydjwGRM4twCRBKyY8wz1lyuvPQ21xtRstI4SzAxZPqHC7V9My5IV3Q1xVaeES4Uhj2Bgx68cscV0imLsvcQbghoLyCfuQGckJDyNvKsqwDfDVq7N9boUKbASKqR2L527q65ES1K3kpyS28wQQVHZEJDwABwuavp+/WnCkg7Ig/NkQbdVhZ6Oi81jwOo1dcUsHaLvou5JKFyt0/VZ+se5avJPFO1XPvbOPBZmR9GgSlv4KlaFLDGaGg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 14 Aug 2023 16:04:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.08.2023 17:34, Andrew Cooper wrote:
> On 14/08/2023 4:21 pm, Jan Beulich wrote:
>> Question therefore is whether we can find a way of effecting the needed
>> overrides (including for compiler generated calls) without resorting to
>> emitting .equ (or alike), and hence without doing it fully behind the
>> compiler's back.
> 
> --wrap= each symbol, except when compiling wrappers.c ?
> 
> This seems to be the normal way to mock out functions including malloc()
> and friends.

What is --wrap= ?

I was thinking along the lines of

void*memcpy(void*, const void*, size_t) __asm__("emul_memcpy");
void*memset(void*, int, size_t) __asm__("emul_memset");

This looks to work at least for explicit __builtin_mem*() invocations,
without LTO. Inspecting the LTO object, though, doesn't show any sign
of "memcpy" in any of the strings it embeds (custom functions are
recorded with strings one can recognize), so I fear this wouldn't work
there either. (But if indeed so, I'd wonder if this wasn't a compiler
bug, as then we don't do things behind the compiler's back anymore.)

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.