From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by server2.sourceware.org (Postfix) with ESMTPS id 4B7D7381DCF8 for ; Sun, 8 Mar 2020 23:35:59 +0000 (GMT) Received: by mail-pl1-x643.google.com with SMTP id d9so3219424plo.11 for ; Sun, 08 Mar 2020 16:35:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OIUo2yTX9pRv/DaH7pHKV+wNptn6XzNuPYZzoB737Pc=; b=o9nyxXa7Qtt5+9XVgZpc8s/EU3/j0jnnwFlLE88V7CtDDBcKZkfNfktK15fjbJ9gK0 1leiorZ7aJKW7BFPDhMFhP93lrHgi6tIakvnT7GwP9JdqRgCuZOC9gDGwm5eB4pvMFH6 9L7GXegm7o7V975pRoxY02rI4jB57YKWHsZpRr1IUV2JWE/CIhvO0nhtH4MlIW9V8Gok A8m9TNPLmSVipqEHK2rV4CJvA2IQHt6nJyhAZJyOuVWgnARHcTcMcasXuRA47MqwO2IL 6J60pDLMTZes7mXkANfGOboQY4OBBDIp8QztXHP4CLOmn8vLDNAnQ+PPVemTpmtdlqnC 2cug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OIUo2yTX9pRv/DaH7pHKV+wNptn6XzNuPYZzoB737Pc=; b=pWSkbjAuHoesbV3H3a0YtQcbK8q7HyvwxuN2Fmtn3iYWqOFMv7TI+V58erUqfh8cog zkRv+Y5BQ/Lp9lt03FsRPv6+tWyreeQH0srRAltA4xdnUtqPMqUKxObo2aoKrKqRif7m Ad2E4ql+6+/FO04lEQLb/Avme5hMoMSsLuLcjdlKeOREwEy/8JvAJEhLp3TNOdLzzkpv wKjErH92vBu5JSuoU7VNyNj4XGYyA80vRVedpbChwkJyO/DzHJ1TeUu1inTFRocfXaC1 V873/QSOrkTQZpNdCNi/n/QJEp+RafRo1ixX+oUVjn/l33upq/XdsvalHy6rTkHE6hHJ uOdQ== X-Gm-Message-State: ANhLgQ31Q609Uoj9PBfEa24ZqTJTEFsze+EOg8CLFoSY6/d5n0KcrpfS IFWdM3QUfxjv5acgNJRsM3s= X-Google-Smtp-Source: ADFU+vs45+rjq+/OzxvBe2WftCCWrdphN+OT6Wx2+rGsUY30t3gT5NVdaQcJ7TsiipUBc8y7zzTjfw== X-Received: by 2002:a17:90a:2a0b:: with SMTP id i11mr15260990pjd.157.1583710558437; Sun, 08 Mar 2020 16:35:58 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:988c:7271:b2a7:35d0]) by smtp.gmail.com with ESMTPSA id z63sm41888119pgd.12.2020.03.08.16.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2020 16:35:57 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 1E91989F42; Mon, 9 Mar 2020 10:05:54 +1030 (ACDT) Date: Mon, 9 Mar 2020 10:05:54 +1030 From: Alan Modra To: "H.J. Lu" Cc: Binutils , Kaylee Blake Subject: Re: RFC: [PATCH] ELF: Don't require section header on ELF objects Message-ID: <20200308233553.GG5384@bubble.grove.modra.org> References: <20200308175947.GA911529@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_2, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS 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: Sun, 08 Mar 2020 23:36:00 -0000 On Sun, Mar 08, 2020 at 11:06:33AM -0700, H.J. Lu wrote: > On Sun, Mar 8, 2020 at 10:59 AM H.J. Lu wrote: > > > > Any comments? > > > > Kaylee, do you have copyright paper with FSF? > > > > H.J. > > --- > > Section header isn't mandatory on ELF executable nor shared library. > > This patch adds a new linker option, -z nosectionheader, to omit ELF > > section header when building an executable or shared library, adds > > an objcopy and strip option, --remove-section-header, to remove ELF > > section header from an executable or shared library. > > > > The PT_DYNAMIC segment contains DT_HASH/DT_GNU_HASH/DT_MIPS_XHASH, > > DT_STRTAB, DT_SYMTAB, DT_STRSZ and DT_SYMENT, which can be used to > > reconstruct dynamic symbol table when section header isn't available. > > For DT_HASH, the number of dynamic symbol table entries equals the > > number of chains. For DT_GNU_HASH/DT_MIPS_XHASH, only defined symbols > > with non-STB_LOCAL indings are in hash table. Since in dynamic symbol > > table, all symbols with STB_LOCAL binding are placed before symbols with > > other bindings and all defined symbols are placed before undefined ones, > > It should read > > --- > all symbols with STB_LOCAL binding are placed > before symbols with other bindings and all undefined symbols are placed > before defined ones, > --- That's new to me. I don't think there is any ordering in .dynsym among non-local symbols. The patch looks OK. -- Alan Modra Australia Development Lab, IBM