Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2057149ybl; Thu, 19 Dec 2019 07:23:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzXnSvC5BZirs73WvGwr3p8JgZ1ikc9Ii2yWmAgE205X16NyI841aMM4JVPKXDwN7wXIgPR X-Received: by 2002:a9d:7c8a:: with SMTP id q10mr8808774otn.124.1576769007683; Thu, 19 Dec 2019 07:23:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576769007; cv=none; d=google.com; s=arc-20160816; b=XcZKHjIJLhwrmL7++Phx3/vGwn1wKCwbsyQXZKjQgjk4p9GSK0VAb+f+Pllmtvrbpk rQVGkqTdMtI/MM/URix6EKhcUCEBADSE2fXbtMQBpeTOMaGc0BotJkJyqkX4bwX/oBmN RW9cH3NZLTRmYcCcHZLu9OtIonvYr6OT3WyNL/AFPgPFCBgpvMTPNEfoOyP9RJUQ4NFY aQR26f/BTCEWyQOVuAmXzOFPzYqaIkE3PVZ1kDCBmOrE/Y54H24+P8lqTZEAlVhW2ZgP j2ODRBJuNMfmquRP0s7o9Tpc0MfO+L5t8KXqfSyZlTiHVY4dDxdfvuuZzARwnIa080Jd 1fBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:reply-to :from:subject:message-id:dkim-signature; bh=Sv2ROrXh7f8SaxkMKHELvqrWudHsHniNHJkfBfNFQXA=; b=Q6m31q24R+O5ti607Uwgzo3HeOojwcQzHMPI5jVdJMuBAvpAKqFgils/Uel1QcO6ep rT60OH4evKgaC0v2xkJSNXSbfEa/ldez4an0B4VuD/VehrV1AA96ch08nVafHK/KLhCj 8U5cjm6oE0DElDVehncn4M/3JR9XKu1s17L2pafzqbHWGRZaK+wtiD5Fda6/hSWDTmEm NZyVTWK2Nn0im2Q+rp/vYeEOKK+LaeQLv7kY77Ur+GyKd2BxsOJybr3DiNBun4YxX+W9 nKjJ5uwMWZi/CKtJyfwX5bx89Lgb5nnM3hghMC5amept5Cf87ZWHK7c/YvM8MU7DAbaz taaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fK/vdp83"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si3055228oie.196.2019.12.19.07.23.15; Thu, 19 Dec 2019 07:23:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fK/vdp83"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbfLSPWK (ORCPT + 99 others); Thu, 19 Dec 2019 10:22:10 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:37158 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726760AbfLSPWK (ORCPT ); Thu, 19 Dec 2019 10:22:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576768929; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sv2ROrXh7f8SaxkMKHELvqrWudHsHniNHJkfBfNFQXA=; b=fK/vdp83V+2Fgns1vbJC1OF0HPSLIbd8JXgUplO8iwbURD4HWM7xX1erVOgxcPcqCgsrKn M3rM2PHyfTXKpytsVLRKq1uj52sG34E8+y7x3Uwcv7b/p8c5YJ7DfBkNFOityuiBqI42Hz lnhpg6TtXRRSTMkz2vXDJC2dRyGQ+Zc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-351-8_7f2AwAPiuM5uHeqvDK8g-1; Thu, 19 Dec 2019 10:22:05 -0500 X-MC-Unique: 8_7f2AwAPiuM5uHeqvDK8g-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 187E58D8A40; Thu, 19 Dec 2019 15:22:03 +0000 (UTC) Received: from ovpn-112-19.phx2.redhat.com (ovpn-112-19.phx2.redhat.com [10.3.112.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25EE369414; Thu, 19 Dec 2019 15:21:59 +0000 (UTC) Message-ID: Subject: Re: [Q] ld: Does LTO reorder ro variables in two files? From: Jeff Law Reply-To: law@redhat.com To: Kirill Tkhai , Peter Zijlstra , gcc-help@gcc.gnu.org Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org Date: Thu, 19 Dec 2019 08:21:58 -0700 In-Reply-To: <3db1b1c8-0228-56e4-a04f-e8d24cd1dd51@virtuozzo.com> References: <157675913272.349305.8936736338884044103.stgit@localhost.localdomain> <20191219131242.GK2827@hirez.programming.kicks-ass.net> <3db1b1c8-0228-56e4-a04f-e8d24cd1dd51@virtuozzo.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 (3.34.2-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-12-19 at 17:04 +0300, Kirill Tkhai wrote: > CC: gcc-help@gcc.gnu.org > > Hi, gcc guys, > > this thread starts here: https://lkml.org/lkml/2019/12/19/403 > > There are two const variables: > > struct sched_class idle_sched_class > and > struct sched_class fair_sched_class, > > which are declared in two files idle.c and fair.c. > > 1)In Makefile the order is: idle.o fair.o > 2)the variables go to the same ro section > 3)there is no SORT(.*) keyword in linker script. > > Is it always true, that after linkage &idle_sched_class < &fair_sched_class? I certainly wouldn't depend on it. The first and most obvious problem is symbol sorting by the linker. Longer term I'd be worried about LTO reordering things. In the end I'm pretty sure it'd be well outside what I'd be comfortable depending on. jeff >