From patchwork Fri Jan 19 19:45:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 189663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1245639dyb; Fri, 19 Jan 2024 11:46:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWInjCfbq03/1n3TlS+fjWP9HSrMI4WkhQ/0Sxck92JLT+9ryC3dsHP3aydR7HqrUcw05M X-Received: by 2002:a05:620a:170d:b0:783:e4e:33ea with SMTP id az13-20020a05620a170d00b007830e4e33eamr659814qkb.71.1705693571668; Fri, 19 Jan 2024 11:46:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705693571; cv=pass; d=google.com; s=arc-20160816; b=uYoWlMv6VR0mswfVTZREJt9Y7ESGizdwGugQRpBoSVPArzOKgqVqjsaUFiaRNfGTBR Fry8d4KC/hbm/no8Aaf4FzBq5PB3gMPVcJghmmOMKFrHrgpiTdr6PxcWKr3T9UCIcCD6 LV7ePuk+OZJTeWSos0UijfYi7nnT4amIE48QZjmC0MYUQ3DX3PgqqY1wSX9zoJFWMx3x c2dDmyj28616BKxg/US38nCWq3JoSH8moL0/9AtgjFu8Zw2KSgIThHcl8d62V4Yoqubk 69Btzv+z21PGYDMCyl4ajk4dGc6ECuXvZFUdbV1+x7mkEdiQNBTxQNiYOX2hm4CnbCzT tl5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=eiRhm/SFhYQSUWcbAheGnWodl8EYmeghEJUA8R94uVw=; fh=I4TDTPfdhpJth25vq3MR3x6A2ccRZ5VQhtbAuQn+ryM=; b=zb5S2FygHpjLdn/a9hKQNnvjcxfoAyR5wdHOr9BP+sVjHMxeKSgLaKikN4u1IgFs5i +cYNZPf09vudzovEyO66IjRzLfxAZ62geN0ZmZXz5Reic42SQHjUbWxt/ha81PcRRH2a YyRne5DSmMw0jkuKCMMjly4SdkhDlRQYOxTzUvdiF9OB1XakQNK8CSmFfCov0V17x7CA mbU49L8ZzR7L1pO1XGWxe1qpHCy8xGZ1V0s4Azf9MaLyhBPbrrwzbzet/bZmpXcbFx/B iVaIvOc9wagQeBzsgrCDCZUaHI9kfTeOZt0iiGD/gqfRqLocvp2PzGmGG8Rj5rXPLXLY EHwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bwuJsVym; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id da32-20020a05620a362000b00783338c59b2si16248740qkb.596.2024.01.19.11.46.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 11:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bwuJsVym; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5B150385E456 for ; Fri, 19 Jan 2024 19:46:11 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 902443858C2D for ; Fri, 19 Jan 2024 19:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 902443858C2D 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 902443858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705693559; cv=none; b=UGqNBBX1y1vPZe2QNkUmx6lld/pHb54zxrE0RhrGsokBVmixArYCmEqnO2RtEATHqa2dZG4+HcIRCfd1Bq/BN7PBo9QKbDwIdGoaS9T/0ROnEFyhOzKnpq346ky+6yR8rHePuqwOpMmbCdO2oscdcEKqpHeyoZkxs3Jj3S6u/FE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705693559; c=relaxed/simple; bh=/l2FZuGeJpU/bk2zl7y9IXgWSIUMTl+bhvmLk3r592o=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=w+u8MS+UsqStDfpdi3R9sr/sVlyclNGXzmDntD0mPogbTm7P5iPZsas289abn++IAM4qQr+IbDV0cJpq6NrUhv3XpBuqZx5b/yxnmGIG4y4420TkKi/467q3eU894pu/LwcvuSoVm0YTtmhBjwQXya69CqZ1S1RbROePGgtMgs4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5ce74ea4bf2so830468a12.0 for ; Fri, 19 Jan 2024 11:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705693554; x=1706298354; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eiRhm/SFhYQSUWcbAheGnWodl8EYmeghEJUA8R94uVw=; b=bwuJsVym02DCg37kolc0RYqUn43pyJtKLtgJ/YJHCd9zqYBOA/XxGhTcYd9hF3hH5e L9Y58xKyJgDX79hix9WJOXX9S8KKfHF92DrP7L5QwGbhogvQU2zwapwxko4vHG9rk+Fz uRETFgodZlBvYdtmuI8wvSNCRFOOKD2Agxo9EAFKQhN1yN0BvwxCRHKmM+mVGXPt6MGJ +B7RPmkPVuCmZL/Tk9Uk5J1IAiXlCW39S01ZvXArDNM8711ZdcYSKsGdDZjnN9YiBKQ/ u37PERZavoBJAMoTT3o8FlnuNYAhg45x9lNfk+oWU6Z5mQ3olXwqcsavMjYDAdnvSWw2 2P4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705693554; x=1706298354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eiRhm/SFhYQSUWcbAheGnWodl8EYmeghEJUA8R94uVw=; b=n1rgSYOyzWhupPasbizp9YkIJfHRUv0/9sZ6RV0n4QqHKLublmp8uyvlv+1fwGpN80 bbr7WWnYOtRsoLZY+PE0dItzLlyQOP2IoACVFtjdZ9FoplCxn4XZ/8wKQrUVjv7A6nmX wS5tLIPrKN1I07XAiJneZ1oW7588SBL6ULWyhao0clxlSy5IVFmj/B9k7GAfjx9uEuu1 xK4Cqkrnj6juIOyq9uA/WodZXSBL/zgyKLmPtj5NKsNJSMOwekWbDZ+houO5/YCzZT2o pNe+NKr+8hbrRQ+L2OGWJK39mJtMYOvH+EzdvSlNwrJFprplbWfwSeD8wpl1dRLTD5oB /YOg== X-Gm-Message-State: AOJu0YzErx64zvoBBQE2969LfqkgkYnWQEOBuen9Bxkh/35RgMaoQStC lXkeBRgQgc6Ul/T/d/08FTJe56uuy+fI1jJAE1LXHyN9yS6j0MGYzIKwCZSW X-Received: by 2002:a17:90a:e642:b0:290:38f2:8a05 with SMTP id ep2-20020a17090ae64200b0029038f28a05mr485761pjb.5.1705693554471; Fri, 19 Jan 2024 11:45:54 -0800 (PST) Received: from gnu-cfl-3.localdomain ([172.56.168.9]) by smtp.gmail.com with ESMTPSA id sn8-20020a17090b2e8800b0028afdb88d08sm4494177pjb.23.2024.01.19.11.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 11:45:54 -0800 (PST) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id D9A2E7406A1; Fri, 19 Jan 2024 11:45:52 -0800 (PST) From: "H.J. Lu" To: binutils@sourceware.org Cc: goldstein.w.n@gmail.com Subject: [PATCH 4/4] ld: Document --text-section-ordering-file FILE Date: Fri, 19 Jan 2024 11:45:52 -0800 Message-ID: <20240119194552.1255481-5-hjl.tools@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240119194552.1255481-1-hjl.tools@gmail.com> References: <20240119194552.1255481-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3024.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788549342638159118 X-GMAIL-MSGID: 1788549342638159118 --text-section-ordering-file FILE is supported only in ELF and PE COFF linkers which support input .text.* sections. * NEWS: Mention --text-section-ordering-file FILE. * ld.texi: Document text-section-ordering-file FILE. --- ld/NEWS | 3 +++ ld/ld.texi | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/ld/NEWS b/ld/NEWS index c3ebe320e5e..c98570f308a 100644 --- a/ld/NEWS +++ b/ld/NEWS @@ -1,5 +1,8 @@ -*- text -*- +* Add the linker option, --text-section-ordering-file FILE, for ELF and + PE COFF linker to specify the input text section order. + Changes in 2.42: * Add -z mark-plt/-z nomark-plt options to x86-64 ELF linker to mark PLT diff --git a/ld/ld.texi b/ld/ld.texi index 4fda259a552..d1bb59202de 100644 --- a/ld/ld.texi +++ b/ld/ld.texi @@ -2541,6 +2541,17 @@ patterns in the linker script. This option will apply @code{SORT_BY_ALIGNMENT} to all wildcard section patterns in the linker script. +@kindex text-section-ordering-file=@file{file} +@item text-section-ordering-file=@file{file} +This option groups input text sections together in the order specified +in the file which contains the list of text section wildcards starting +with @code{.}, separated by whitespace. + +If the @option{verbose} option is enabled, the contents of the text +section ordering file will be reported. + +This option is supported only in ELF and PE COFF linkers. + @kindex --spare-dynamic-tags @item --spare-dynamic-tags=@var{count} This option specifies the number of empty slots to leave in the