From patchwork Thu Feb 29 22:54:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 208542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp727299dyb; Thu, 29 Feb 2024 14:55:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyAtmEujxzdZnMQrfFNtId2hLWfSK7H69StbcGFdWrpO6fY7FXpr6UbNR5ArOq0ulkA2Q46VyFUbLJY529wUtA2wHmSQ== X-Google-Smtp-Source: AGHT+IGjUvNIr/StXRNqXc31HiEU4iqvonoQ8eNG4Y2PS9GRlLVIOXBLMy2kHE8K9GU3PN57XF/u X-Received: by 2002:a81:52c2:0:b0:609:7404:8809 with SMTP id g185-20020a8152c2000000b0060974048809mr456790ywb.6.1709247302369; Thu, 29 Feb 2024 14:55:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709247302; cv=pass; d=google.com; s=arc-20160816; b=zm0l2T6DXM+hq/Gan/O6tXY7z8JrWi1N/qChnK9/rRPqbXngCiiuDr2FoL944aiiMR VkwW1PG+m1lcSXYI423mc565jAwUGXSPaoiESXifA0b9ZifeadBPlczCLOOKasP039op CXaLwnOoC51phbtZxqfYjQVyZ7VZcjcNlZi4PRSHQmuX4PXM4q3OTu5YY5lkfGZ4VEoN kdmh6Q644S797sOAFMeEfCBjNPo0avFWzIOVzvyZ2XbBNYpTQE54ci39jJb8M42MOKR2 2AOVv6i8NuChML720Tw7ylhykuFQarZF3zsaZ+3VLrpPeGLb0NwFKiuur75RHA7vg/oz 8lYg== 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-disposition :mime-version:message-id:subject:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=qaAltBwXZpLI6F0ZR1vQZEwhYKyifB92TgUYKAi8ghY=; fh=NLxAvL/bDfPg4AGOtxqvQlND8vazkZrNzKLY8+LAbBY=; b=ThGDy0cm1vpDFQNAOfqZ1TfZeTFC3ByXwJNFhG0CckZnkc380xMpzA9Rk3TliMd/CJ JcG7Lw4fis5Oa+9IiNO+6nf/DNJL7+bzA660u+ryRt6Tefi075kVpIQ5jfGnpiNZeMM2 X6NVQBf4RO1qie2Hd5ljdxLeZlln9x6ine8qfGu0YAHcCaEDfG/hp7GrZVrshTptT8BZ jqFXYtzmE299hGAAhPrvmcQiswoShUSWM2Lhg+stuKMa/BCLMsM6Zocw1Hy9QrmiA8vb 7zLoui+MzEBbVJB8gbnquIthSqRNOxurJN5RXDkiPVbTdvWE8X4GQ9nCBndWRJorzQaM qFiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PIxTBDZf; 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 f25-20020ac86ed9000000b0042e59e7b042si2135641qtv.714.2024.02.29.14.55.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 14:55:02 -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=PIxTBDZf; 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 0A7DF385840A for ; Thu, 29 Feb 2024 22:55:02 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id E8A113858D34 for ; Thu, 29 Feb 2024 22:54:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8A113858D34 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 E8A113858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709247292; cv=none; b=cjcNEyIP9VUUgl8oiIE0W/2M8ai/W671xzayblRSjrXAidULNdyn6SjoexZCKevD/DL+gpiziV7XhMo7twSWbY6OLxaZW/VaPNdx/1zbXtnoXRrY5gW/QONd4/8UFd/pPSl5FJSnhZWOI+BhWx2eu+fimlLFALt1jidfFhqo/Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709247292; c=relaxed/simple; bh=VXp3X0Nm2zSfmAHGh8vBw9GnfLO7O4ZpIGElACBqAH8=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=oAdLgz5ZsUoogXmYqZjtIBkdA6vTYFo9t5y5l2Idngw9yXhpiXzGQbEvDOdYWrO1Ai/YAlkhqi82bgH+waL8TqdmfaTW8x2LEgN1ulgX7XavreTc0Q3hme+uKNWS1q2p72pnQZ4aT8DBl2XCjZJjMqa7VMJ6tmMLRQZIsBPHsQo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6e48e42a350so750790a34.1 for ; Thu, 29 Feb 2024 14:54:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709247289; x=1709852089; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=qaAltBwXZpLI6F0ZR1vQZEwhYKyifB92TgUYKAi8ghY=; b=PIxTBDZfNMgiDc38UZgKB6cKvKZjN3NWFkOssyBn+szdzxLKZn9D3OB4bJCDQ93LY4 IPKBdUk1rnGox0XFfze/If+T2hxnQ5zx5PWppSjMWQTK/BMXtK1t+L11vLu+ABrbV67Z y/5WVYv5gP7rh0zt0snvOR9tbSGHNL2OrGoDJ2iTGit5tJkK0q6BmjXt68K7IU4XHZKn y4o0xiinki1krj/268zgmHqkquH8F5f8FwOQnm4RCkj6+wuu707i+rbBXuOWcUKI4cqD YqQ3SK/HlWwC4YVu+HoW+ni49KEk6HhlZhiIB+rsOzMpSubcqmS4T1soRbxfn+nG4Io5 /B7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247289; x=1709852089; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qaAltBwXZpLI6F0ZR1vQZEwhYKyifB92TgUYKAi8ghY=; b=KV6HZeP3GPkAKWWY2VOHRbteoxfhqC5BEbR7gDZg1l7PyEb/nj36gSEP1XLdZyaznn J9GcIY1NT8HAMy3YDxDCZJFdV90n1eLJXhbu0Hxc4Q73qcgvXDPz3r0PiKf6fanIJ5CG ZdI8uKiZS1xVyNZY4SM8Gxafed8loyXctB4zUpg0ohpDduaXgYxhdiVogwmX+cSv8QZI zl2G0Ggu/99ykNNgiKmLJbYW3ROzlwlrVKq9GaeZbXHXz0QMCKArQFSNru8nnpMPx/r5 xkOlTmYBrPBm0tmX0j1yd+lvc4LRjbYqRrWpSoRQnEAdM8LQmGVt1moezUUYcFiNgIES sJvQ== X-Gm-Message-State: AOJu0Yym+AxBFLPbA7I8wdDHSwKb7x3BXvlxge1h8609HS79j+9AoTDK YZhEaKKqpNPcs9u6xzX/l5RrOvWVu8XkwxPtT+3wLjnF9Z332al34kDuVZCX X-Received: by 2002:a05:6830:2093:b0:6e4:82a4:742e with SMTP id y19-20020a056830209300b006e482a4742emr142268otq.0.1709247289435; Thu, 29 Feb 2024 14:54:49 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id c2-20020a637242000000b005dc36279d6dsm1838436pgn.73.2024.02.29.14.54.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 14:54:48 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 8CAAF11402C2; Fri, 1 Mar 2024 09:24:45 +1030 (ACDT) Date: Fri, 1 Mar 2024 09:24:45 +1030 From: Alan Modra To: binutils@sourceware.org Subject: PR19871, description of --pie Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3033.8 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: 1792275699568186514 X-GMAIL-MSGID: 1792275699568186514 Say why we even mention shared libraries here (ET_DYN), and clarify symbol resolution. There are of course many other ways that PIEs resemble PDEs more closely than shared libraries. PR 19871 * ld.texi (-pie): Clarify. diff --git a/ld/ld.texi b/ld/ld.texi index 3cba778c9fb..6f234752278 100644 --- a/ld/ld.texi +++ b/ld/ld.texi @@ -2298,12 +2298,13 @@ the i386 PE and ELF targetted ports of the linker. @item -pie @itemx --pic-executable @cindex position independent executables -Create a position independent executable. This is currently only supported on -ELF platforms. Position independent executables are similar to shared -libraries in that they are relocated by the dynamic linker to the virtual -address the OS chooses for them (which can vary between invocations). Like -normal dynamically linked executables they can be executed and symbols -defined in the executable cannot be overridden by shared libraries. +Create a position independent executable. This is currently only +supported on ELF platforms. Position independent executables are +relocated by the dynamic linker to the virtual address the OS chooses +for them, which can vary between invocations. They are marked ET_DYN +in the ELF file header, but differ from shared libraries in a number +of ways. In particular, defined symbols in a PIE by default can not +be overridden by another object as they can be in a shared library. @kindex -no-pie @item -no-pie