From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from guinea.birch.relay.mailchannels.net (guinea.birch.relay.mailchannels.net [23.83.209.79]) by sourceware.org (Postfix) with ESMTPS id 40C7A385DC31 for ; Wed, 21 Oct 2020 09:15:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 40C7A385DC31 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=siddhesh@gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EA6F5121D56; Wed, 21 Oct 2020 09:15:10 +0000 (UTC) Received: from pdx1-sub0-mail-a61.g.dreamhost.com (100-98-64-6.trex.outbound.svc.cluster.local [100.98.64.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 420B3121D75; Wed, 21 Oct 2020 09:15:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a61.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.10); Wed, 21 Oct 2020 09:15:10 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Zesty-Abiding: 03bf10f63f74ea6d_1603271710500_2378838272 X-MC-Loop-Signature: 1603271710500:3222535728 X-MC-Ingress-Time: 1603271710500 Received: from pdx1-sub0-mail-a61.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTP id B94DCB6021; Wed, 21 Oct 2020 02:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=SLu+qW At4XOLR21syvlbniiQ7Bk=; b=gcbwIiPVuxxJeIzHGnqJt7F/wUk3W9cpPvcpeJ jxyWEaXsH1RzpM2aehwNvmes+kl2OLFgZlo9v5E4KAowOmxDLvLgvPZwhySvT9M2 rixzRUuyA3KZSB3rqjirxWsD8eHtfiDS/OSnSdtsGpR4zTp7A76euVIQtE0TTtaj CMybQ= Received: from [192.168.1.111] (unknown [123.252.202.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTPSA id 34E76B5CEC; Wed, 21 Oct 2020 02:15:07 -0700 (PDT) Subject: Re: Randomize offset between program segments? To: Topi Miettinen , libc-alpha@sourceware.org References: <412c5a60-fbaf-d53b-3be9-32efe496509a@gmail.com> X-DH-BACKEND: pdx1-sub0-mail-a61 From: Siddhesh Poyarekar Message-ID: Date: Wed, 21 Oct 2020 14:44:56 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <412c5a60-fbaf-d53b-3be9-32efe496509a@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Oct 2020 09:15:14 -0000 On 10/21/20 1:10 PM, Topi Miettinen wrote: > Sorry, I forgot to mention that the code is also compiled with "-fPIC > -pie", so PC-relative accesses will be always used. PC-relative accesses will work only if the offset between the code and data is known at link time. It implies that it is fixed at runtime, which won't work for your use case since you want it to be dynamic. Siddhesh