From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by sourceware.org (Postfix) with ESMTPS id 7CE1C3858426 for ; Mon, 18 Oct 2021 07:56:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CE1C3858426 Received: by mail-wr1-x432.google.com with SMTP id v17so39578158wrv.9 for ; Mon, 18 Oct 2021 00:56:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=S3lGnAKoX9lq8jt1+jEuIW47t+F0MOAnv7sIWlEpvvE=; b=eND7GHHWBoQIwvoW5WmJDAENobu0nLMESuLcbcqid/GvJ7/njwsKG6kOSaQ6jnQPmg gG2e+NeRiUZ+4aMQalQq59uv92m2cUZCW3USb0TYL6FMuG4LmVv3tu/fJwwjIvMr421u 8c8+BI0OYfevpEpvq2nf0UwQey92Zxu+HK7gcSC/z2qhOm7rrb/IzdeCrBje5/T3Bzcj M3zK35R3urBkucWF34a1PQISglzWKQy7K7qoZd0eSMcW7AKwwlpn67uIOkpI/px/aYLF ERoMvmsd/n2S5dTYaBhjZRvaes9tUOaPEMGBFwc7zRAU7R3tQjzsHaa6DpA0QsRS7TQS gaLg== X-Gm-Message-State: AOAM530RjZ+Qe+Q5icuOwcZ4ivryVXNYVzxk28GOacv1IhqnnKqcu8Mm 8i8QnEDGAipIC+xEZubSAuk= X-Google-Smtp-Source: ABdhPJxl/3rw8Vi6XjuUcd3IhT/iSxfd4U9XM3wMj9xzezOdv9xRnFy4H+oRAECqV6Un/eKGCveFow== X-Received: by 2002:adf:a28f:: with SMTP id s15mr8396078wra.138.1634543775621; Mon, 18 Oct 2021 00:56:15 -0700 (PDT) Received: from fbmtpc92.tugraz.at (fbmtpc92.tugraz.at. [129.27.144.111]) by smtp.gmail.com with ESMTPSA id k22sm11871607wrd.59.2021.10.18.00.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 00:56:15 -0700 (PDT) Message-ID: <8d2ddbb76479ce3ad7f99acb3f0b79a6a8d1440b.camel@gmail.com> Subject: Re: wide function pointer type From: Martin Uecker To: Florian Weimer , Martin Uecker via Libffi-discuss Date: Mon, 18 Oct 2021 09:56:14 +0200 In-Reply-To: <87czo2hjiq.fsf@oldenburg.str.redhat.com> References: <9362563f8803f575d00c03835d2897b3836a7645.camel@gmail.com> <857da973fe5bbb94a363114262b57d42b35cc1f6.camel@gmail.com> <87czo2hjiq.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libffi-discuss@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libffi-discuss mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Oct 2021 07:56:17 -0000 Am Montag, den 18.10.2021, 09:36 +0200 schrieb Florian Weimer: > * Martin Uecker via Libffi-discuss: > > > In particular, I would be good to know whether > > implementing a perfectly forwarding stub for > > a variadic functions that loads the static > > is possible on all architectures. I assume so, > > but I am not entirely sure. > > Are you asking if it is possible to consume an argument in a variadic > wrapper and forward the remaining arguments to a variadic function? The > answer to that is no. Yes, I assumed this does not work. The question is more whether architectures exist where the existing ABI states that the static chain has to be passed as a first argument (which would then need to be removed when calling a regular function). The implementation most architectures would use is that 1) the static chain is loaded from the wide pointer 2) stored in the designated register or stack slot and then 3) a call is performed using the same calling convention as used for regular functions. If a regular function is converted to a wide pointer, then the static chain would simply be NULL which should not affect the function. Martin