From patchwork Sun Jan 12 07:07:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 104601 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E90CC3857810 for ; Sun, 12 Jan 2025 07:09:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E90CC3857810 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=hzZ74Maz X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by sourceware.org (Postfix) with ESMTPS id A257D3858027 for ; Sun, 12 Jan 2025 07:07:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A257D3858027 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 A257D3858027 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::831 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736665677; cv=none; b=Q95awAbSfmnDz+NT8/VhIJfs6acFfw1I3ks5xolly2RnCNOtqKpbtnyOnQ1ig+OPqVzFbFmGL1RnmVMMbTkIm53NvLDKUZg7/s9zzFI++IlWcxyJYITdNzEvDBhj292vw/zI+hZI8jvHDV/CcFkA0fpIUgzOrnerZ1NOeDwtyuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1736665677; c=relaxed/simple; bh=Tq1Ve/pJ3YezOdzUXNoaNvvBokx2VOH63oB5SWr0uBQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WYZ5byXHlNCMEyzk/+k3zGxRECaA7OBfZC17zfGLMcdbXCFDQs/MRPk5ad9rEqgQw9//RSccpodXeN0UpBIu15ghVTmXd7NG7aln8WPElhDwbgcsyzZuEX8aWThq+LtzzlfIaoXByKtHUx/r0Dvr+S9I/cfQ2RiHFLNFpu8tWWg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A257D3858027 Received: by mail-qt1-x831.google.com with SMTP id d75a77b69052e-46b1d40ac6bso27671761cf.0 for ; Sat, 11 Jan 2025 23:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736665677; x=1737270477; 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=2IisGT3IhSziKEkMFjzIN8yeMCmktakGDCN1QBg9Idg=; b=hzZ74Maz9VXKZuSo0U0hDl2pk2oddAC9wU5NweFfjLatbX3Wsampix6QmEcP0O5MuB oDmbvX73yzfCzQeIy7XnM7ee1TResFut3W/KjyqwQwqCDPxaR9nVgwcNIB0YvYdQIJEM PwpgPJvee02w8HhT+/zlemxjPA2YF2q35h6Qb8XFujltYJZc+hkg76toMRSlAWZvTwaw nIH95DBGNNdyoAwP1+mn6Ijx8NuIKh61hplojj1JUnADhEL/0Pi7hY/NbcMg9QBELhYB kitKzY0Y/9RlQ5F0/+DGAEsdJipF4rqdr1uW2cf07FpvYaIuIriqnXZ7sspO/6vcHIzZ ZNjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736665677; x=1737270477; 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=2IisGT3IhSziKEkMFjzIN8yeMCmktakGDCN1QBg9Idg=; b=T2MkXPDXOAyA4mxBwCzgrnAjSifHIDgZRV+7eHm1b51xQNU6TTtUzMTaVoo/lVtev/ iC0gZ3ZnQCPX1Lxm/4EHesQ0WzBxgbTeisH7ngFnwXA5NHf3ViUz2knLqtSeM0gc/CgJ je/9PO1gekHJff/CHcEV9bVdqq5T5pffpWf8EjxVcBHlU7Qkq8GaG1RBX5AB+xOPnJJA P4p4F3BqwYcHDYrwODca9W823+qzI0vMpqArJg0E4tuEVgSVKVp4U5+FW58wQSJYst3u tLivp1osFzeECae7Lg56tMj+Zy6F6K3YnJmLNABvR6nRbWdwfpcdtHpYYJJeiBFCeWNP Qsrg== X-Gm-Message-State: AOJu0YzUkre4vQbW3loi+v0n0nhg4TzJecT4DpcxtCHXgeUPkIEYfVP/ itVUND8gN3uwzvQ3tyobgl/Wji0QRPBFYEOo7kGbyLYrOSIbavAwfUMWZt57z3zFuLGV X-Gm-Gg: ASbGncs94pS7D1/38ssjg7goV4uXTCTSDjNfBihDJ4TQtAhnRRaTf9KHUT9+GZKTsr3 nFKjiXrFmkU1U5rKAC6LlCe/5t+D5px07dnCw5440ri/4IgYwcqPGC0GqqVl2K7xWTZb1tCsccZ X1vQsges/3uz73n5lIIxz6Lr0i45/EFwMC4d96aTeKlVI4X4McQHwZRlj7KO8bqXvQ6lwuO01lM bo7i21DkwLCTbdP+XeDtxUqeA3KOLiUr/2nw1BkU7MBJ3vupGQZNa7dB9SS0hxVXW/BQDfv9Hz5 fBFastv6vnAgc+fYEzDUeDT3anwepWZBUjxYqvFvuqwe X-Google-Smtp-Source: AGHT+IG/v6H1FvVxbndPrHKhDeYdjHrIK3uZ413kGH+/Ri0HVI9qqrPlX3Ej91Q6SMLqdkFficjNnA== X-Received: by 2002:a05:622a:cd:b0:467:60da:12ad with SMTP id d75a77b69052e-46c9956ce39mr65122481cf.5.1736665676815; Sat, 11 Jan 2025 23:07:56 -0800 (PST) Received: from gnu-tgl-3.localdomain ([172.58.139.89]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46c87321555sm27889851cf.8.2025.01.11.23.07.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 23:07:56 -0800 (PST) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 3723DC0595; Sun, 12 Jan 2025 15:07:52 +0800 (CST) From: "H.J. Lu" To: binutils@sourceware.org Cc: i@maskray.me, nickc@redhat.com, sam@gentoo.org, hp@bitrange.com Subject: [PATCH v3 2/4] ld: Document mixing IR and non-IR objects for -r Date: Sun, 12 Jan 2025 15:07:50 +0800 Message-ID: <20250112070752.2883068-3-hjl.tools@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250112070752.2883068-1-hjl.tools@gmail.com> References: <20250112070752.2883068-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3018.5 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 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~patchwork=sourceware.org@sourceware.org * ld.texi: Document mixing IR and non-IR relocatable files for "ld -r". Signed-off-by: H.J. Lu --- ld/ld.texi | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ld/ld.texi b/ld/ld.texi index da714a20855..f8a3f9df13a 100644 --- a/ld/ld.texi +++ b/ld/ld.texi @@ -1126,6 +1126,17 @@ relocations. Different output formats can have further restrictions; for example some @code{a.out}-based formats do not support partial linking with input files in other formats at all. +On ELF platforms, when the relocatable output contains both IR and +non-IR contents, a .gnu_object_only section will be created to contain +a relocatable object file, as if @samp{-r} is applied to all non-IR +relocatable inputs. When processing a relocatable input with a +.gnu_object_only section, the linker will extract the .gnu_object_only +section as a separate input. + +Note that since @samp{-r} groups some sections from different input files +together, there may be negative impacts on code size and locality in +final executable or shared library. + This option does the same thing as @samp{-i}. @kindex -R @var{file}