From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by server2.sourceware.org (Postfix) with ESMTPS id B7A033945055 for ; Mon, 9 Mar 2020 00:02:47 +0000 (GMT) Received: by mail-ot1-x344.google.com with SMTP id i14so7909884otp.5 for ; Sun, 08 Mar 2020 17:02:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hJHZ09v5X6oDjcr0t3eYjFkuZ5UHzSSQ3EotI6CYhLA=; b=gBmiCNl7mAv+e+HZducuGuT+cBk5lSrIcz116Fj4+TLgZpZrj8RNVf7h3hwQ7Y5J0r MB/iRtwVT2ZKxxvEPEuDhemEtZUy+pRD2LfbmFUb0x8+qwW1GS7VgCGmwo/7+7Uwk9x8 B0qj0mESOCp88c0YChDT9m5beIwDYxPO4wcHdVPgkQyx8Fw/Nv4h3CTQG8Zd3E9GzvQb JmcP8MryVjd8mvs1Q0dlEiSfprhiVHRdfmGJSW+h6rgRQGjhIMXa7h8zFd0f5lQckNQv qX/GJ4QDs/AHsNnV/bCdmJSeK5pJFh9Tn8g9Gx0Fue3POcaPUbnrWMliMduv7cFEcfeF cpQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hJHZ09v5X6oDjcr0t3eYjFkuZ5UHzSSQ3EotI6CYhLA=; b=KEi12BZhnYu7IpxWWvAL9XhCCkDyHePeStpV7KKLfvqNhhnIik6u72uoDUJas8c8m7 y1OWmJm3VjNVts7LcZ5FdH1awYeyWFBH0oo3/mHM5e4I0NqggJQjkfyL6pA9kVECn1Q5 IIBQ750npJR8HNS2AjIpoPqz1WmfByUqFQu0HRpw9wOy8Mk5OXvz7WWv9AWga9kXsLOi ny6H+rxmtciaa6EqjSQN74H+eimNTtpAqUDqlYf6TTp/YRFh5/sr3yu10PWaixph5RgA lSzv8EuQCmsjcPjsLzfr0ukFGzcwj0ThekLPqH5vxREVsQtJwPM9231DQKZWRL6s2RE1 1XmQ== X-Gm-Message-State: ANhLgQ3BxmS/Z5JZmpyaBvV3hGanfG1z4OrbWNQlSYhGL85eTUEB70WV HoxQ6vSjBLb2pHuq8pGinlikn+LarInajE8OOQ/PqX+D X-Google-Smtp-Source: ADFU+vs+JrI9sno55M3deJ1C0MTYcHLJAf6/v7ViuWuytOlSq3mwrnIm1IawH0UQvt6BAduZTbEv3gFEZOpd8+xZ4R0= X-Received: by 2002:a9d:21c5:: with SMTP id s63mr10696238otb.142.1583712167143; Sun, 08 Mar 2020 17:02:47 -0700 (PDT) MIME-Version: 1.0 References: <20200308175947.GA911529@gmail.com> <20200308233553.GG5384@bubble.grove.modra.org> In-Reply-To: From: "H.J. Lu" Date: Sun, 8 Mar 2020 17:02:11 -0700 Message-ID: Subject: Re: RFC: [PATCH] ELF: Don't require section header on ELF objects To: Alan Modra Cc: Binutils , Kaylee Blake Content-Type: text/plain; charset="UTF-8" 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: Mon, 09 Mar 2020 00:02:48 -0000 On Sun, Mar 8, 2020 at 4:46 PM H.J. Lu wrote: > > On Sun, Mar 8, 2020 at 4:35 PM Alan Modra wrote: > > > > 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. > > I will get clarification from gABI group. FYI, https://groups.google.com/forum/#!topic/generic-abi/oDQ3Z3IDYuU -- H.J.