From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12olkn2082.outbound.protection.outlook.com [40.92.21.82]) by sourceware.org (Postfix) with ESMTPS id F2185385DC35 for ; Sat, 30 May 2020 00:59:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F2185385DC35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=i@maskray.me ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oD2Vy/SzZQT4vG5dMchwoBQ0yzSuoo24VWQepNpqgSXroWs2XFY95BTXg1wNV/5oBgYVwdqDP9V+L5AfyuAKVvhxqeTglRaxjSOwm+1tCl+cF21zeL875owsMkhgW5iSv/mcE/wO58hqYAgLrxZXGauvYgwF0I9h3KVn3BRKMD+aAtYqJqB0edBifCjTAMPLQ+DV+KNwhcuBa5q/XZdWxroujLIJwRLubHZSV5ipFA2viWSamlnkGCwLoFD0QbTMSNPFj3ECHu8MCRlRUvvYUWx68lzqTsbGusPf74vewWbyXP23HCeY5RnK9tD7cVW8INmjCTBMUoPftgYBjXWq7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JqoC+Qrr+s3Z0A1HCJ+23Yw7p+curPXCPrIXaeghjvE=; b=Jes5Gljs8xVJLzC3LVF0itDpo2I1k5BOCb/CpADgnrwaQjzCdMTLl4uWijBHUko1YZXGSZrIcibYLVbS59Rklnnb/G/JJCJI6cGGY6I6iOU0ByZ9R5rWWekf+CHy6kqreyNiklcD5vNYTTlPzM8CPDFYtND3YkIg2SsaMQdo/UrHSPrpYTZcHSf1DFJBcIC1gvOIOA9fVw+GIqUnAa2NP0/1o4p3qTrRk8TkjwwkgKvhzTjYLaCKg7y7zDZfqxsf0WArBAVFKTUVrcjlgIN76UxdW26cLbnzz1lgGSLWcYbti9c1V6UmEdgHlg63RXZSc0FC476J/hoMQuJ91JTAag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BN8NAM12FT010.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::4e) by BN8NAM12HT120.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.8; Sat, 30 May 2020 00:59:52 +0000 Received: from MWHPR12MB1456.namprd12.prod.outlook.com (2a01:111:e400:fc66::53) by BN8NAM12FT010.mail.protection.outlook.com (2a01:111:e400:fc66::62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.8 via Frontend Transport; Sat, 30 May 2020 00:59:52 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A9AE5315E6232076D598023789C537234530472A6FAEED63F17CF3A212995C64; UpperCasedChecksum:88E1FF8C2D03926E536FC4F6A82C602FAEEFE9D372AF6D3776AAC4EE5771589A; SizeAsReceived:9824; Count:56 Received: from MWHPR12MB1456.namprd12.prod.outlook.com ([fe80::4539:a2c4:b80b:d9c4]) by MWHPR12MB1456.namprd12.prod.outlook.com ([fe80::4539:a2c4:b80b:d9c4%11]) with mapi id 15.20.3045.018; Sat, 30 May 2020 00:59:52 +0000 X-Gm-Message-State: AOAM5303O84rXsuaH+kyaAWe0/nyy5D+MGtSknx4YFWmEGxSMp2tBPJS KeL75WkVlsdfaPwxtioZ8qRLOGRctwEg4MT91Uc= X-Google-Smtp-Source: ABdhPJxnBwlWAUGbtXsK1LMpftvQvoDC8MdmGt8IhwzJeYL+/664WGyjI4rGQ48ZgY9Q8NFh65HcsIyr0geWo0emPyA= X-Received: by 2002:ac8:7552:: with SMTP id b18mr12321382qtr.150.1590800389056; Fri, 29 May 2020 17:59:49 -0700 (PDT) References: <20200525182830.744267-1-hjl.tools@gmail.com> In-Reply-To: From: Fangrui Song Date: Fri, 29 May 2020 17:59:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ELF: Updated comments for ET_EXEC and ET_DYN To: Alan Modra Cc: binutils@sourceware.org, "H.J. Lu" Content-Type: text/plain; charset="UTF-8" X-ClientProxiedBy: BL0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:208:2d::14) To MWHPR12MB1456.namprd12.prod.outlook.com (2603:10b6:301:f::9) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mail-qt1-f173.google.com (209.85.160.173) by BL0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:208:2d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Sat, 30 May 2020 00:59:51 +0000 Received: by mail-qt1-f173.google.com with SMTP id w90so3521048qtd.8 for ; Fri, 29 May 2020 17:59:51 -0700 (PDT) X-Gm-Message-State: AOAM5303O84rXsuaH+kyaAWe0/nyy5D+MGtSknx4YFWmEGxSMp2tBPJS KeL75WkVlsdfaPwxtioZ8qRLOGRctwEg4MT91Uc= X-Google-Smtp-Source: ABdhPJxnBwlWAUGbtXsK1LMpftvQvoDC8MdmGt8IhwzJeYL+/664WGyjI4rGQ48ZgY9Q8NFh65HcsIyr0geWo0emPyA= X-Received: by 2002:ac8:7552:: with SMTP id b18mr12321382qtr.150.1590800389056; Fri, 29 May 2020 17:59:49 -0700 (PDT) X-Gmail-Original-Message-ID: X-Microsoft-Original-Message-ID: X-TMN: [6nmVQz7rtOEjrp1o3j3Ot7VdhcLnYvL5] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 56 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e96637bf-854b-44b9-8321-08d80434c1ee X-MS-TrafficTypeDiagnostic: BN8NAM12HT120: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FJn6n/aUH1YfjHgxHfnVjPCkT5IfQf8zOzEF08XCSklTAOdksuOrtYreOyQDmvBECcefZT4XRrl813s9Km6jAWopVPKUpSyixtjGa1jACX4Syp2lyDRCRHdmTS16Fy54ppV1J90dt3QD9pXV/tVNiB6mfSOhCIQ3mC6BTio/VS79HvIhwzx/cJChekZXUAG6hjp8Q2lVWb3y4lPiKpu5uLXCfqlXiGcN6wtoXflFZaTcbpUOqtZyo83pKkKpepxU X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:0; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR12MB1456.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:; DIR:OUT; SFP:1901; X-MS-Exchange-AntiSpam-MessageData: 8mJes4xsOu6nXgFf6J7BZOn4WBNEmTZ+pI/sDZSSvzveTMAvmrdJMvf4PNtTfF7jgD83T/d0CLrATlzZYV8fvVPfa5pwdgXn6WPkDw2qjUXL28vMYGqgaTsAiPzKR7s4TLQwsCsLTqSMvEhlu4o/Tw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e96637bf-854b-44b9-8321-08d80434c1ee X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2020 00:59:51.9486 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM12HT120 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2020 00:59:56 -0000 Does https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=d871d478061f10b0879c688e2fa941407e9137aa start to set DF_1_PIE on non-Solaris platforms (e.g. Linux) as well? I guess previous versions of binutils don't set the flag. This flag makes sense to me, because it makes the distinction of executable/shared object for ET_DYN. On Tue, May 26, 2020 at 10:45 AM Fangrui Song wrote: > > Looks good. Ali in the generic-abi proposed a more generic form: > > #define ET_EXEC 2 /* Position-dependent object */ > #define ET_DYN 3 /* Position-independent object */ > > > I just filed https://sourceware.org/bugzilla/show_bug.cgi?id=26047 We > may consider disallowing ET_EXEC as linker input. > Happy to know if there are legitimate cases, though. > > On Mon, May 25, 2020 at 11:28 AM H.J. Lu via Binutils > wrote: > > > > include/elf/common.h has > > > > #define ET_EXEC 2 /* Executable file */ > > #define ET_DYN 3 /* Shared object file */ > > > > These predate PIE: > > > > https://groups.google.com/forum/#!topic/generic-abi/mBKlSNldFW4 > > > > Updated comments to > > > > #define ET_EXEC 2 /* Position-dependent executable file */ > > #define ET_DYN 3 /* Position-independent executable or > > shared object file */ > > > > * elf/common.h: Update comments for ET_EXEC and ET_DYN. > > --- > > include/ChangeLog | 4 ++++ > > include/elf/common.h | 5 +++-- > > 2 files changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/include/ChangeLog b/include/ChangeLog > > index c309780544..53f50e513f 100644 > > --- a/include/ChangeLog > > +++ b/include/ChangeLog > > @@ -1,3 +1,7 @@ > > +2020-05-25 H.J. Lu > > + > > + * elf/common.h: Update comments for ET_EXEC and ET_DYN. > > + > > 2020-05-20 Nelson Chu > > > > * opcode/riscv.h: Include "bfd.h" to support bfd_boolean. > > diff --git a/include/elf/common.h b/include/elf/common.h > > index 26e6fbc8e6..4d94c4fd5b 100644 > > --- a/include/elf/common.h > > +++ b/include/elf/common.h > > @@ -91,8 +91,9 @@ > > > > #define ET_NONE 0 /* No file type */ > > #define ET_REL 1 /* Relocatable file */ > > -#define ET_EXEC 2 /* Executable file */ > > -#define ET_DYN 3 /* Shared object file */ > > +#define ET_EXEC 2 /* Position-dependent executable file */ > > +#define ET_DYN 3 /* Position-independent executable or > > + shared object file */ > > #define ET_CORE 4 /* Core file */ > > #define ET_LOOS 0xFE00 /* Operating system-specific */ > > #define ET_HIOS 0xFEFF /* Operating system-specific */ > > -- > > 2.26.2 > >