From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 437D0386100E for ; Mon, 5 Oct 2020 06:16:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 437D0386100E Received: by mail-ej1-x62c.google.com with SMTP id md26so10152980ejb.10 for ; Sun, 04 Oct 2020 23:16:24 -0700 (PDT) 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:content-transfer-encoding; bh=o6X+8wFw2j127XXDoSnnLiMCJHszP7UoracBZ8v3T6w=; b=kWhSBpVFMV12OspI0ZDfhzJq7AC+cSWWjVdLKXpfpuUZ2EsNYtGXUchnuKoVNyuFf6 aeuCNIZqe+z8fnVQEQraAIFb+1Nuu4Cd1Bkr5LoYe31lIQZR3JcO6n4tTCqSUzqPvjNB Xh8Ta0GvWRPiokXjZf/+BUPguHOswWDSo9g0LuocPBVTs/5lRntKLEr2GwPze4qLuwSt yJwjEBL73Nilnd4X6HYczgA6v2dqRjEYYm1/+WtV84BfbFPz1Ir7kbjHVZ5wOksBs6ZF 1FHnWZ1+yEenkFQgg0EXuEbMfT0tUZJUC4Wap7kof38ja+Y8XAmLo5wBEQj0KaJoNC0y 7lFA== X-Gm-Message-State: AOAM5314CdPIaJ5OARKRFV/M79Do1URlTgFzCJw/im+OCMPwMH+0X12a 51RmGNfsp635dIkeTzdz2fF7aersLjhZCwzQBLU= X-Google-Smtp-Source: ABdhPJxsw+/eYKsGWt1kTihoSid8MnwVeuhOyiMx/oRWp24XpDez/5Oy7AElMyKDtlMuUv/IJyMSQNa4jIpiBLKh9Wo= X-Received: by 2002:a17:906:dbf7:: with SMTP id yd23mr13621385ejb.281.1601878583249; Sun, 04 Oct 2020 23:16:23 -0700 (PDT) MIME-Version: 1.0 References: <20200912063031.GC5452@bubble.grove.modra.org> <20200913060522.GG5452@bubble.grove.modra.org> In-Reply-To: <20200913060522.GG5452@bubble.grove.modra.org> From: =?UTF-8?B?TWlsYW4gQnXFoWth?= Date: Mon, 5 Oct 2020 08:15:56 +0200 Message-ID: Subject: Re: build kernel for arm64 - linker ld ignored -z relro To: Alan Modra Cc: binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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, 05 Oct 2020 06:16:26 -0000 Hello. ne 13. 9. 2020 v 8:05 odes=C3=ADlatel Alan Modra napsal: > > On Sat, Sep 12, 2020 at 06:35:58PM +0200, Milan Bu=C5=A1ka wrote: > > so 12. 9. 2020 v 8:30 odes=C3=ADlatel Alan Modra nap= sal: > > > > > > On Sun, Sep 06, 2020 at 04:45:52PM +0000, Milan Bu=C5=A1ka via Binuti= ls wrote: > > > > Hello. > > > > I'm compiling the kernel v.5.8.7 on arm64. > > > > This is a compilation in a native environment. > > > > Toolchain: > > > > glibc v. 2.32 > > > > binutils v. 2.35 > > > > gcc v. 10.2.0 > > > > > > > > This is the last part of the output after make Image. > > > [snip] > > > > LD .tmp_vmlinux.kallsyms1 > > > > ld: warning: -z norelro ignored > > > > > > I suspect you are not configuring binutils correctly for > > > aarch64-linux. A target of aarch64-elf for example won't give you a > > > toolchain supporting relro. > > > > > > > I compiled binutils according to this configuration > > > > --prefix=3D/usr \ > > --build=3Daarch64-unknown-linux-gnu \ > > --host=3Daarch64-unknown-linux-gnu \ > > --with-lib-path=3D/usr/lib:/usr/local/lib \ > > --with-bugurl=3Dhttps://github.com/archlinuxarm/PKGBUILDs/issues \ > > --enable-deterministic-archives \ > > --enable-gold \ > > --enable-ld=3Ddefault \ > > --enable-lto \ > > --enable-plugins \ > > --enable-relro \ > > --enable-shared \ > > --enable-threads \ > > --disable-gdb \ > > --disable-werror \ > > --with-debuginfod \ > > --with-pic \ > > --with-system-zlib \ > > --disable-sim > > > > Best regards > > > > Milan Buska > > Hmm, I don't see anything much wrong with that, and it looks like > archlinux doesn't make any patches to binutils that might cause the > problem you're seeing. I suggested it might be an aarch64-elf config > because the only reasons to see "-z norelro ignored" are > GENERATE_SHLIB_SCRIPT not being "yes" or COMMONPAGESIZE not being > set. The latter happens with an aarch64-elf toolchain. See the > relevant ld/emulparams/ files and ld/emultempl/elf.em. > > -- > Alan Modra > Australia Development Lab, IBM Binutils is fine. The problem is in the linux kernel code. The error is caused by arm/arm64/Makefile. line 105: KBUILD_LDFLAGS + =3D -EL $ (call ld-option, -maarch64elf, -maarch64linux) Solution: KBUILD_LDFLAGS + =3D -EL $ (call ld-option, -maarch64linux, -maarch64elf) Thank you for your support. Milan --=20 Remember, no question is too stupid and no problem too small -- We've all been beginners