From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by server2.sourceware.org (Postfix) with ESMTPS id A7D8B3945047 for ; Mon, 9 Mar 2020 00:05:48 +0000 (GMT) Received: by mail-pl1-x644.google.com with SMTP id ay11so3256072plb.0 for ; Sun, 08 Mar 2020 17:05:48 -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=WQRQoYlFyQxXMgnfY+2TKgDn/Z1sDRhkMs9MAPnD71Q=; b=PTUmYTcqcOe2ly+S1UiiZwVaSUDaaFLckOBTgLlS42ORW0EQWH/7CZumsIYxRrdBHo tVsWaTJLqK3cZAN7Rx7wq0sLcAB3v1FkLQABRSCuDbBHO4lNSnT2SupYnKlj7GY2/vna e1J5m/4/KfHRwD7BnPqtxWFGKUoKE1mt8bHzI/k5hMlFXPFtzezWvwPBTn26VajljsEr tkBmRrmYgW7Gbd+KAnno4FL95kjLbj5zr1F5P/cyC1BFdq/fyLxiYmcw6mN/fvH+LPwr Xmie66aFRe/MR+hfOcnecaS/zXB4rip/PtChO7oFaBTBsIot1cEe2cENZYOd0NR1Aa+H 8cAg== 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=WQRQoYlFyQxXMgnfY+2TKgDn/Z1sDRhkMs9MAPnD71Q=; b=hG9RvX1DHrw0iiu5tTfqHk0KN7Gzuu//WiLjYxRl0hIanbTM9ncyi/NUAZfysz94Fk CcA/2Oy99mxs1S3NQyGWZwp8OfKh4n6ubqb731y6aGjgS7TVEJxTlzmjP63tfQICxva7 Z7KS8gyd/YXI2qwTeorkhPtDrHZkz54z0LwOp90NaIMyQIbF2nkXMb6LiCWR86lvaMYA StWN5NyI6i1OM0dWe5Nn3u6L3kE5wXxTK7xxScvXYbO56oCBPvE/zSrse9vD5676V2t5 qBuQbkVESBejapI2fPIvHC4icIufXtuANBQl57TOIB3UJHUhUaFBWNtaWFw9fPticrBw 4g6w== X-Gm-Message-State: ANhLgQ2dErnBTRrFie80MG0ZyE0Ul6Lme1iTdE7pgTbA24CPpU5Pi3RT mr+/vXlxz1b8y7ATv66DuN1VqKENOK0= X-Google-Smtp-Source: ADFU+vuvmKAHHySn+cjo4AhkAjAYfjjJrIHtJ8ksJq3EAI9UzHtWhIhgq9XwfbSuoznah796SJH9sA== X-Received: by 2002:a17:90a:b10d:: with SMTP id z13mr16204206pjq.132.1583712347825; Sun, 08 Mar 2020 17:05:47 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:988c:7271:b2a7:35d0]) by smtp.gmail.com with ESMTPSA id e30sm42659040pga.6.2020.03.08.17.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2020 17:05:47 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id CA3FA89F59; Mon, 9 Mar 2020 10:35:43 +1030 (ACDT) Date: Mon, 9 Mar 2020 10:35:43 +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: <20200309000543.GJ5384@bubble.grove.modra.org> References: <20200308175947.GA911529@gmail.com> <20200308233553.GG5384@bubble.grove.modra.org> 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: Mon, 09 Mar 2020 00:05:49 -0000 On Sun, Mar 08, 2020 at 04:46:51PM -0700, 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. Well we certainly don't do such sorting. For example, from a freshly build ld/ld-new --enable-targets=all 148: 0000000000f08380 4 OBJECT GLOBAL DEFAULT 25 opterr@GLIBC_2.2.5 (3) 149: 0000000000402f80 0 FUNC GLOBAL DEFAULT UND calloc@GLIBC_2.2.5 (3) 150: 0000000000881536 35 FUNC GLOBAL DEFAULT 13 _obstack_allocated_p -- Alan Modra Australia Development Lab, IBM