Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2066252ybl; Thu, 19 Dec 2019 07:32:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxsVoWK1osjMmyyxs/A2ZXgeGAOFbyb3XyaPxxd4SDoDyK+w/Q64cu0rSl1XbRqtVysx3i0 X-Received: by 2002:a9d:7a4d:: with SMTP id z13mr9439030otm.148.1576769548270; Thu, 19 Dec 2019 07:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576769548; cv=none; d=google.com; s=arc-20160816; b=l7dVOdCPwvOEDrsXDfvhLARkUWeYG7DnaR1KsKdH+BWyPCuMxHwj+Gy4aghjCi9bdr 5eYfIlv/zeONLJHU+wWD0FVuq93VwXTDX8jjeD0TM4iObZTFzGN3y4d5IfVyqL43nhgi 4QkVWU2qTWpXqj5WeE4NS7+MdYzLoZgrdcYxlk3xAHhXfeceT2xwXZ6mXxlr32Bzlf9g nXr556lx83YXGINCs+dlCkwkymFDIW3xTbw2q+kLNBAlNEXTTxAIrIIwJ92m6ZfkUlGj B/uMIzEfLAxc2dv7RBdLxDfEOfmdhEjjC+4ykKi93m+tkyBx/kEcZUj1SZjYgB/8PBqc Mvyg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YqE/PMJXCZgIJljcNwviFuIGlmll3zePb0eVK8Sz0ho=; b=dS7exn3Po/5kM74oADCy7JkyyL+v8uhA4gLh4NNcUfmubmAZSLMVqIy1QkrzErIttU gNKCih4mL2ZQA2xoIom4yFcKD0iDmkPRR8K22gYKoXc4OUDnMcgF96q3DLp9hQLlHK41 P1fAKOHBufn0LHQrGGTKxgYkBQTHi9OVrLXiuKP02+C5Vqifj7qYzUUfptVWAtI2xxOk RJQwtZNJbCtQxIcJ4NBaRSoqyyNNPNp9Z++t8bVqHZnkbYlf9E9JOjS23JU906ZDK9NP zU5A4j4tnmOkDoNzdJ9w6adcTiwdTPOGIK0Ck8ZjzjQ2B4WV+gT/LVBbfdR06p5mTDbk ZorA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o129si3271581oib.236.2019.12.19.07.32.16; Thu, 19 Dec 2019 07:32:28 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbfLSPbR (ORCPT + 99 others); Thu, 19 Dec 2019 10:31:17 -0500 Received: from relay.sw.ru ([185.231.240.75]:56494 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726760AbfLSPbP (ORCPT ); Thu, 19 Dec 2019 10:31:15 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104]) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1ihxlV-00078I-67; Thu, 19 Dec 2019 18:31:01 +0300 Subject: Re: [Q] ld: Does LTO reorder ro variables in two files? To: law@redhat.com, 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 References: <157675913272.349305.8936736338884044103.stgit@localhost.localdomain> <20191219131242.GK2827@hirez.programming.kicks-ass.net> <3db1b1c8-0228-56e4-a04f-e8d24cd1dd51@virtuozzo.com> From: Kirill Tkhai Message-ID: <15d40d09-3258-9b78-7120-bc708a429855@virtuozzo.com> Date: Thu, 19 Dec 2019 18:30:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.12.2019 18:21, Jeff Law wrote: > 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. Ok, I'd be comfortable too :) Thanks for the clarification, Jeff.