From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 82BD33858D20 for ; Mon, 22 Jan 2024 18:22:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 82BD33858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 82BD33858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705947774; cv=none; b=G50JROHsNvWyKGj8sZnJjomU99caQvUB0m3cYcbRvY5D0bka33Ck7TM6Oj/OPAJtmhJAf+NIqWXZ741l9tlZTE8rTZ3qAoeoq/JtB80HFQMfcvkgAvkB+oP71kXG0/eiX8ssmzcyVwfZ5gYXexFHQyiSI8akxccFNdfOJjJLqAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705947774; c=relaxed/simple; bh=C4wKKS6PmD8Uc8zUqlRiYC7H8tCtn1+DcF+Am2OBrnQ=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=EspeOrv7mxXa+3CBURKE8H/3qApwDV/93ICGXsnUCusl6vpk+Wlog4FX/GrXuDl4vx1Zxl4m3eSyIHIcpVQgV/3F5DzDe0FX4Ahv3HKqJ0CuAE8a5ySOKeLn5JonXrqVrN1cK1NYe+BfKaTb9na5TM3X8zwMT/odbkTeEWJeq0s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6e0df9aa43dso2713001a34.0 for ; Mon, 22 Jan 2024 10:22:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705947772; x=1706552572; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=C4wKKS6PmD8Uc8zUqlRiYC7H8tCtn1+DcF+Am2OBrnQ=; b=kIg15jx+hvHeiNUrCkCSBe5Gt03GM5zv4QrQIB6nGeaojPQhhFYZH0GHVL7LuhsRJ3 OxwNODoewMTcFuTKwNoSTK57A3HW3HBgfgNwry2Rr/IvPqi2DI1dkR+pYwg3TN//reN7 ip1+xWSkPAQ351YpBcXa7qFmUdzIB7dhHqeyWYFj3X8pTDriqqVhdN2yZUJrOes7HvI3 HUd1Mva7e9JQW375JXJIQjvbAZRbbhijR9aAwEVb62wHl0dHfsEuek6jllTqbbwWgHEy TVyAHEBwbSE2W2MHFKmUUjxxUWfRqNnYWLLdxCLJNp2p7TKoW+5nI+Zi5F5rMS4iBO/l IGmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705947772; x=1706552572; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C4wKKS6PmD8Uc8zUqlRiYC7H8tCtn1+DcF+Am2OBrnQ=; b=rx5Mu0JEBcVl3x6Kx+B8ocxn3fLamtj/ITkaY4OkUeQZ7Jd3X9bv474qn2bp+N+Ldr 0c/cQw9UqUktFvQOttSOq2wKbYOefTcWowcM6ByV6n6d74NwUyafIdPBvtXkGZJMMyRg 1spG+fJYB9PFxCWZGTN6GQxUWHhJYEnA8NgoaX9xF11I6tqmeLH+hZGG+QP6VS6wiUaA iBQ5TLf1SbPe9VovmloyRyYHHjXuvacXKbfiifvipg+v4xaneNzg+YvHSlJ57lwLsCsy aY2vDMbfciLai5jmNo3o04ZARlnGlfenz7d1GQT3zDFN683LMjemuXaV5QoI9EAu0mlN 4kxw== X-Gm-Message-State: AOJu0YzW06CPoXb565yxyg2KK0/BHjRe+D8fBr3dqNsKm527Nrv15bqC ddt0l+0esA7cmwjnJriaM/LpzZsZ7TeeJAsJHDHeg5g3wvysV+Q/0GF11YgPXkfzfAjTrGWs/AM lhJJr7DyPpeq5z5T/blJCmdB5dng7mtjYZZo= X-Google-Smtp-Source: AGHT+IG2ebIR4dd1sGvAmQ9rCJFvY2M/YTqwvdkjXEyX2dF8JXrwtlfbJcUB3ekueLVPg23+wN7T/+sc3OT1ctOFwI0= X-Received: by 2002:a05:6870:32cb:b0:210:b88b:baf1 with SMTP id r11-20020a05687032cb00b00210b88bbaf1mr356312oac.31.1705947771773; Mon, 22 Jan 2024 10:22:51 -0800 (PST) MIME-Version: 1.0 References: <20240119194552.1255481-1-hjl.tools@gmail.com> <20240119194552.1255481-2-hjl.tools@gmail.com> <038d66e4-e85c-4ca0-822c-c18a1cc6edd0@suse.com> In-Reply-To: From: Noah Goldstein Date: Mon, 22 Jan 2024 18:22:39 +0000 Message-ID: Subject: Re: [PATCH 1/4] ld: Add --text-section-ordering-file FILE To: "H.J. Lu" Cc: Jan Beulich , Fangrui Song , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.0 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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Jan 22, 2024 at 12:52=E2=80=AFPM H.J. Lu wrot= e: > > On Sun, Jan 21, 2024 at 11:37=E2=80=AFPM Jan Beulich = wrote: > > > > On 20.01.2024 00:15, Fangrui Song wrote: > > > It is a shame that the new feature only applies to .text . Data > > > sections and other code sections should be reorderable as well. > > > > I second this remark. In fact I wonder why it is that text needs > > The perf data usually provides guidance for text section layout. > > > treating specially here. Can't the option just be > > --section-ordering-file and then permit covering all kinds of > > sections? Another issue with this approach is that it won't work for custom linker scripts (because the `INCLUDE` of the ordering file has been manually inserted in the defaults). A different approach for this patch that may alleviate both concerns (work for custom linker scripts + for arbitrary sections) would be to update the logic of `section: NAME` in `ldgram.y`. We could insert the script contents upon entering any new section. This might blowup link time (if a link script is inserted at each section), so we could add another auxiliary option to specify which sections the config script should apply for and make it default to something like `.data` and `.text`. > > It requires much bigger changes to ld. > > > -- > H.J.