patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	 Paul Mackerras <paulus@samba.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	 Alexey Kardashevskiy <aik@ozlabs.ru>, Tom Rix <trix@redhat.com>,
	linuxppc-dev@lists.ozlabs.org,  llvm@lists.linux.dev,
	patches@lists.linux.dev,  Fangrui Song <maskray@google.com>
Subject: Re: [PATCH 1/2] powerpc/vdso: Remove unused ENTRY in linker scripts
Date: Mon, 9 May 2022 14:05:48 -0700	[thread overview]
Message-ID: <CAKwvOdnqFRhFvhFeGzKiVCp53iULFMhKeGmgf=n_sCohRt3q0Q@mail.gmail.com> (raw)
In-Reply-To: <20220509204635.2539549-2-nathan@kernel.org>

On Mon, May 9, 2022 at 1:46 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> When linking vdso{32,64}.so.dbg with ld.lld, there is a warning about
> not finding _start for the starting address:
>
>   ld.lld: warning: cannot find entry symbol _start; not setting start address
>   ld.lld: warning: cannot find entry symbol _start; not setting start address
>
> Looking at GCC + GNU ld, the entry point address is 0x0:
>
>   $ llvm-readelf -h vdso{32,64}.so.dbg &| rg "(File|Entry point address):"
>   File: vdso32.so.dbg
>     Entry point address:               0x0
>   File: vdso64.so.dbg
>     Entry point address:               0x0
>
> This matches what ld.lld emits:
>
>   $ powerpc64le-linux-gnu-readelf -p .comment vdso{32,64}.so.dbg
>
>   File: vdso32.so.dbg
>
>   String dump of section '.comment':
>     [     0]  Linker: LLD 14.0.0
>     [    14]  clang version 14.0.0 (Fedora 14.0.0-1.fc37)
>
>   File: vdso64.so.dbg
>
>   String dump of section '.comment':
>     [     0]  Linker: LLD 14.0.0
>     [    14]  clang version 14.0.0 (Fedora 14.0.0-1.fc37)
>
>   $ llvm-readelf -h vdso{32,64}.so.dbg &| rg "(File|Entry point address):"
>   File: vdso32.so.dbg
>     Entry point address:               0x0
>   File: vdso64.so.dbg
>     Entry point address:               0x0
>
> Remove ENTRY to remove the warning, as it is unnecessary for the vDSO to
> function correctly.

Right, the vdso is going to be injected into the process' mappings;
what would it even mean for a DSO to have an entry point?
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

>
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/powerpc/kernel/vdso/vdso32.lds.S | 1 -
>  arch/powerpc/kernel/vdso/vdso64.lds.S | 1 -
>  2 files changed, 2 deletions(-)
>
> diff --git a/arch/powerpc/kernel/vdso/vdso32.lds.S b/arch/powerpc/kernel/vdso/vdso32.lds.S
> index 58e0099f70f4..e0d19d74455f 100644
> --- a/arch/powerpc/kernel/vdso/vdso32.lds.S
> +++ b/arch/powerpc/kernel/vdso/vdso32.lds.S
> @@ -13,7 +13,6 @@ OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle")
>  OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
>  #endif
>  OUTPUT_ARCH(powerpc:common)
> -ENTRY(_start)
>
>  SECTIONS
>  {
> diff --git a/arch/powerpc/kernel/vdso/vdso64.lds.S b/arch/powerpc/kernel/vdso/vdso64.lds.S
> index 0288cad428b0..1a4a7bc4c815 100644
> --- a/arch/powerpc/kernel/vdso/vdso64.lds.S
> +++ b/arch/powerpc/kernel/vdso/vdso64.lds.S
> @@ -13,7 +13,6 @@ OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle")
>  OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc")
>  #endif
>  OUTPUT_ARCH(powerpc:common64)
> -ENTRY(_start)
>
>  SECTIONS
>  {
> --
> 2.36.1
>


-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2022-05-09 21:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 20:46 [PATCH 0/2] Link the PowerPC vDSO with ld.lld Nathan Chancellor
2022-05-09 20:46 ` [PATCH 1/2] powerpc/vdso: Remove unused ENTRY in linker scripts Nathan Chancellor
2022-05-09 21:05   ` Nick Desaulniers [this message]
2022-05-10  6:22   ` Alexey Kardashevskiy
2022-05-10  6:41     ` Fangrui Song
2022-05-09 20:46 ` [PATCH 2/2] powerpc/vdso: Link with ld.lld when requested Nathan Chancellor
2022-05-09 21:24   ` Nick Desaulniers
2022-05-09 21:47     ` Nathan Chancellor
2022-05-09 21:58       ` Nick Desaulniers
2022-05-09 22:30         ` Nathan Chancellor
2022-05-10  6:22   ` Alexey Kardashevskiy
2022-05-10 16:25     ` Nathan Chancellor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKwvOdnqFRhFvhFeGzKiVCp53iULFMhKeGmgf=n_sCohRt3q0Q@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=aik@ozlabs.ru \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=llvm@lists.linux.dev \
    --cc=maskray@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=nathan@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=paulus@samba.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).