Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3251304ybf; Tue, 3 Mar 2020 02:29:10 -0800 (PST) X-Google-Smtp-Source: ADFU+vsE+e158CVTxZCCGu6C484IbiHd4FMxon5tZVRTTWfavnYORauRQPGaEcjx5j022qupsnCB X-Received: by 2002:a05:6830:2009:: with SMTP id e9mr2937654otp.296.1583231350049; Tue, 03 Mar 2020 02:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583231350; cv=none; d=google.com; s=arc-20160816; b=XILSMR6XOJLlE23huFPAkrLfG6VbDtt9yf6s+GFlBQONT/M9NhKT1Fl9HzNK10vUcS BgCM5E2OfnoE8N7aCos6gSFltGzcDLaAer0Amn93DjZJbtxJagR0cQ5TCT6nCqOV/9Zc v/C85O7Ih/7pEPYqD6RlBGy9IwRDDaNjMOJnzfblNhNbPDqVmHELYAYxZKRyyWeQ/KEf VxJxdla1pHkThIOeAvPdqiFTm+X82/prgh82/euKClh5X+Aeh1FJdCrmHSDXH1uuNFf7 OPNPtB4K5X3T5qmazab9BNHzTgVzZVACpiK8u5HFYyUPpKV3J3PF9hiz5cq1r5MsZkZ5 ybgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=kvj6nsEfj7HJPh2Cr/nRjGRikEBFIf3T2LP7/NYGLSg=; b=TWd25egFMCTRKK1Zmx6pdazC06Y1olBkkWivN+MuThPygqY/vOcKP+6CWN92KHvyAJ y/dptdPl5YX2S7/tegkBMuRH+oEe7HZBKxyiFZIqQ/92MRbzy6zOScKSB9wxuq+iuCHy YCvWHGeixJDiE0bdRlOkz/I3jAYY9sQtwb+6uOedUbqLbXwrUXj523nBPt+DcUdx03m7 MWh9Poxg+pqKY4MUf2BWB/hk/qdVSFsSK3ppMJ+FxxbUL4feHl+StV5BouFfjNpxDEQ+ KrCZR140vxJ22myp2nPE6KED4qMdTq+nsWXyWJr9wF8weiQR1Ux61ftUCqgf6QB00j7+ xMNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=e2hwoNpc; 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 l1si666795oib.263.2020.03.03.02.28.58; Tue, 03 Mar 2020 02:29:10 -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=@ellerman.id.au header.s=201909 header.b=e2hwoNpc; 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 S1728634AbgCCK2a (ORCPT + 99 others); Tue, 3 Mar 2020 05:28:30 -0500 Received: from ozlabs.org ([203.11.71.1]:56809 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbgCCK2a (ORCPT ); Tue, 3 Mar 2020 05:28:30 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 48WtWt5nQLz9sPg; Tue, 3 Mar 2020 21:28:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1583231306; bh=rR0PX/PIXpmUWEvsjz0jV6bq6v4H0L8THPuMSsBWOU8=; h=From:To:Subject:In-Reply-To:References:Date:From; b=e2hwoNpcmZ8jxUWgWgFC8ksw5tR4ti8FJluJ33yhtXFlL103gKneQZTP+0Y8BQ61H N719f7pQJa0nAvjekPYniWU6o7PlJ2DN2PXEIrbeNb1dLA8F409L1QX+xVs58OnhxA z/2sMLice1M1cF1+EKH9YfGoNWbHcVw2raEcIsXYHBefoQacpH9zw9kcba5rjTEMpR iN+uJPL3hWW6sJWLfe++SwJG1aRnLXdS3I7SCM+uiSbdpETdDFI/RMKCD6qAn7qzPa YrJ1axUSSaXC7qDa9WtbIwNqoJPChWG+hwygJUgiSNOzuhqL96D8lJ4sAB3tShx4D/ Rj/SlH5DAZzTA== From: Michael Ellerman To: "Naveen N. Rao" , Linux Kbuild mailing list , LKML , "linuxppc-dev\@lists.ozlabs.org" , Rasmus Villemoes Subject: Re: eh_frame confusion In-Reply-To: <1583168442.ovqnxu16tp.naveen@linux.ibm.com> References: <3b00b45f-74b5-13e3-9a98-c3d6b3bb7286@rasmusvillemoes.dk> <1583168442.ovqnxu16tp.naveen@linux.ibm.com> Date: Tue, 03 Mar 2020 21:28:25 +1100 Message-ID: <877e01spfa.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Naveen N. Rao" writes: > Rasmus Villemoes wrote: >> I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 >> to gcc-8 all object files now end up having .eh_frame section. For >> vmlinux, that's not a problem, because they all get discarded in >> arch/powerpc/kernel/vmlinux.lds.S . However, they stick around in >> modules, which doesn't seem to be useful - given that everything worked >> just fine with gcc-7, and I don't see anything in the module loader that >> handles .eh_frame. >> >> The reason I care is that my target has a rather tight rootfs budget, >> and the .eh_frame section seem to occupy 10-30% of the file size >> (obviously very depending on the particular module). >> >> Comparing the .foo.o.cmd files, I don't see change in options that might >> explain this (there's a bunch of new -Wno-*, and the -mspe=no spelling >> is apparently no longer supported in gcc-8). Both before and after, there's >> >> -fno-dwarf2-cfi-asm >> >> about which gcc's documentation says >> >> '-fno-dwarf2-cfi-asm' >> Emit DWARF unwind info as compiler generated '.eh_frame' section >> instead of using GAS '.cfi_*' directives. >> >> Looking into where that comes from got me even more confused, because >> both arm and unicore32 say >> >> # Never generate .eh_frame >> KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) >> >> while the ppc32 case at hand says >> >> # FIXME: the module load should be taught about the additional relocs >> # generated by this. >> # revert to pre-gcc-4.4 behaviour of .eh_frame > > Michael opened a task to look into this recently and I had spent some > time last week on this. The original commit/discussion adding > -fno-dwarf2-cfi-asm refers to R_PPC64_REL32 relocations not being > handled by our module loader: > http://lkml.kernel.org/r/20090224065112.GA6690@bombadil.infradead.org I opened that issue purely based on noticing the wart in the Makefile, not because I'd actually tested it. > However, that is now handled thanks to commit 9f751b82b491d: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9f751b82b491d Haha, written by me, what an idiot. So the Makefile hack can presumably be dropped, because the module loader can handle the relocations. And then maybe we also want to turn off the unwind tables, but that would be a separate patch. > I did a test build and a simple module loaded fine, so I think > -fno-dwarf2-cfi-asm is not required anymore, unless Michael has seen > some breakages with it. Michael? No, as I said above it was just reading the Makefile. cheers