Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7575908imu; Mon, 3 Dec 2018 15:26:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvXpeKIc8NvpsGTvEHHq5xrAjw0Cp253QfEHtogGhz7Hg/OJzU3ptdwR2q5jw0aTtQoP2c X-Received: by 2002:a63:c303:: with SMTP id c3mr14951671pgd.268.1543879575564; Mon, 03 Dec 2018 15:26:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543879575; cv=none; d=google.com; s=arc-20160816; b=izyOcp3feeQyY8szFcl4uwa4wBfktA3CEiz1ZQWA77vWnVrx4246IJOIeL8+uhNqlV NMJXqL8SHLkNEU37njuVcHcwM2X45BWAaJwny4vSyeDbUu0MqrnwAivO7J8f7bzLbOwX fICLkACBPAsUJOb5fwgNnvBicn6irWb0elMwUfGZmXiZSL/Z3dacFFP7sMd1+9JUyfrJ pQhtFYUnQ2arlHLyLpG/dCVUOl28+PylypLdS02xMBYSMnu2DjWsl6y756UuXMwezrGt J6FYFPJWtmpKB/CTu1egb48xNlGYF0UTg5xcJUtrwBaguCn7pi9J8IePNSE4ImZJvVSX cU8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ldKQF90m/G5zm935FjxHUATkIgg00xIePjtNug6i8VM=; b=yx4tntIX1WcZAKST74QbwCAgkPxWOpqR88fBMJRoUXrF3LZsTs/XHHlzZxWjXQX71J 2PebmT6Hlb1+r7ikGiOR0ov1dhVoPylm0LMlCqPu46V4Y8rdYOBIuxlPR/2ZEgTIRN53 TPEB0pZsoOn918jZdL0j+Eybdb7VkNpK9jmLqGll65n19/PPM4/axHp3DC7k5CqmKqvH 7cvsl/i9tgGcXuRTNurlIOGHCAHeZpqYtrn656Z/KexwZ7kdALnDxQTfC7gYbuGwkDKk +iK38m6DYNfyvUGrYKDvcbNWcddO0k0hCBNOGMpwdje/wEmsVLtje1f77jXNkn6pjJl6 Gw8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b="B+YL2/0O"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si15263417pls.170.2018.12.03.15.26.00; Mon, 03 Dec 2018 15:26:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b="B+YL2/0O"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725988AbeLCXZH (ORCPT + 99 others); Mon, 3 Dec 2018 18:25:07 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:40961 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbeLCXZG (ORCPT ); Mon, 3 Dec 2018 18:25:06 -0500 Received: by mail-qk1-f194.google.com with SMTP id 189so8494942qkj.8; Mon, 03 Dec 2018 15:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ldKQF90m/G5zm935FjxHUATkIgg00xIePjtNug6i8VM=; b=B+YL2/0ONXElrrEPv2dMfJsRSfvxC482aR/7TaJ5jRjF5EnoxkVwIKxroOdRLq2Svs tA5yiTxcv6jxtfMI6y9+l/IuhVkhvxIsJiDLL1aZO7z6Dds5EyBfI68RynSISP17B6ER C9wwPPLmYIr04gEUy5xugL/KooJZB5bKHEtYw= 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=ldKQF90m/G5zm935FjxHUATkIgg00xIePjtNug6i8VM=; b=SfLryl5EZ0vldClCM66DFQORcHgeWhdAJI1wl0uoBNRXIPpdb6301o0GEK1Datqhv2 cGKzBDCLzm8+z1zsrvUyKwAX72LFrCwrgmH8+pvyS0iE2g+mYygEu7gxhklWCOFmc8zm JjDbqGFYLGmZROpwTexSz5LEAqntJqKDWjizhHjXeCyCx1gCGiUo2K5dgjVvmnYVaCxp wf3DfnrCY63K0oCOoRimrWeYzdwW8kBoKr8+bHc4tF3eBWPououeVpi5getvKgaxkfer GZorkX8wvODqdwcyj+H45Y42Ps+Iu8WfiT/1TQ3DGfSxWkXIEEvCdQ7xmsE8VHATUolk b4hg== X-Gm-Message-State: AA+aEWYajz4rq0itkxn//SOYsND0Sd43OX5ZyKnh80Gawp87/wOkhVXX TstBr6H7GH4sc8Cyu7CvKQTIdWqp4PTXAM3SAQE= X-Received: by 2002:ae9:ef8a:: with SMTP id d132mr16176709qkg.11.1543879504998; Mon, 03 Dec 2018 15:25:04 -0800 (PST) MIME-Version: 1.0 References: <20180612081413.323d85b8@canb.auug.org.au> <87k1lgufiw.fsf@concordia.ellerman.id.au> <20181118112244.GD21617@bubble.grove.modra.org> In-Reply-To: <20181118112244.GD21617@bubble.grove.modra.org> From: Joel Stanley Date: Tue, 4 Dec 2018 09:54:53 +1030 Message-ID: Subject: Re: linux-next: build warnings from Linus' tree To: Alan Modra Cc: Michael Ellerman , Stephen Rothwell , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Linux-Next Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 18 Nov 2018 at 21:52, Alan Modra wrote: > > On Wed, Nov 14, 2018 at 09:20:23PM +1100, Michael Ellerman wrote: > > Joel Stanley writes: > > > Hello Alan, > > > > > > On Tue, 12 Jun 2018 at 07:44, Stephen Rothwell wrote: > > > > > >> Building Linus' tree, today's linux-next build (powerpc ppc64_defconfig) > > >> produced these warning: > > >> > > >> ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'. > > >> ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'. > > >> ld: warning: orphan section `.gnu.hash' from `linker stubs' being placed in section `.gnu.hash'. > > >> > > >> This may just be because I have started building using the native Debian > > >> gcc for the powerpc builds ... > > > > > > Do you know why we started creating these? > > > > It's controlled by the ld option --hash-style, which AFAICS still > > defaults to sysv (generating .hash). > > > > But it seems gcc can be configured to have a different default, and at > > least my native ppc64le toolchains are passing gnu, eg: > > > > /usr/lib/gcc/powerpc64le-linux-gnu/6/collect2 -plugin > > /usr/lib/gcc/powerpc64le-linux-gnu/6/liblto_plugin.so > > -plugin-opt=/usr/lib/gcc/powerpc64le-linux-gnu/6/lto-wrapper > > -plugin-opt=-fresolution=/tmp/ccw1U2fF.res > > -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s > > -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc > > -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr > > -V -shared -m elf64lppc > > --hash-style=gnu > > ^^^^^^^^^^^^^^^^ > > > > So that's presumably why we're seeing it, some GCCs are configured to > > use it. > > > > > If it's intentional, should we be putting including them in the same > > > way as .hash sections? > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/vmlinux.lds.S#n282 > > > > > > .hash : AT(ADDR(.hash) - LOAD_OFFSET) { *(.hash) } > > > > That would presumably work. > > > > My question though is do we even need it? > > > > >From what I can see for it to be useful you need the section as well as > > an entry in the dynamic section pointing at it, and we don't have a > > dynamic section at all: > > > > $ readelf -S vmlinux | grep gnu.hash > > [ 4] .gnu.hash GNU_HASH c000000000dbbdb0 00dcbdb0 > > $ readelf -d vmlinux > > > > There is no dynamic section in this file. > > > > Compare to the vdso: > > > > $ readelf -d arch/powerpc/kernel/vdso64/vdso64.so > > > > Dynamic section at offset 0x868 contains 12 entries: > > Tag Type Name/Value > > 0x000000000000000e (SONAME) Library soname: [linux-vdso64.so.1] > > 0x0000000000000004 (HASH) 0x120 > > 0x000000006ffffef5 (GNU_HASH) 0x170 > > 0x0000000000000005 (STRTAB) 0x320 > > 0x0000000000000006 (SYMTAB) 0x1d0 > > 0x000000000000000a (STRSZ) 269 (bytes) > > 0x000000000000000b (SYMENT) 24 (bytes) > > 0x0000000070000003 (PPC64_OPT) 0x0 > > 0x000000006ffffffc (VERDEF) 0x450 > > 0x000000006ffffffd (VERDEFNUM) 2 > > 0x000000006ffffff0 (VERSYM) 0x42e > > 0x0000000000000000 (NULL) 0x0 > > > > > > So can't we just discard .gnu.hash? And in fact do we need .hash either? > > > > Actually arm64 discards the latter, and parisc discards both. > > > > Would still be good to hear from Alan or someone else who knows anything > > about toolchain stuff, ie. not me :) > > .gnu.hash, like .hash, is used by glibc ld.so for dynamic symbol > lookup. I imagine you don't need either section in a kernel, so > discarding both sounds reasonable. Likely you could discard .interp > and .dynstr too, and .dynsym when !CONFIG_PPC32. Thanks for the digging Michael, and thanks Alan for clarifying the details. I'll cook up a patch or two. Cheers, Joel