Linux-EFI Archive on lore.kernel.org
 help / color / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: Fangrui Song <maskray@google.com>,
	x86@kernel.org, Arvind Sankar <nivedita@alum.mit.edu>,
	linux-efi@vger.kernel.org,
	Clang-Built-Linux ML <clang-built-linux@googlegroups.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	kbuild test robot <lkp@intel.com>
Subject: Re: [PATCH] x86/boot: Discard .discard.unreachable for arch/x86/boot/compressed/vmlinux
Date: Fri, 22 May 2020 08:51:35 +0200
Message-ID: <CA+icZUU58cY31rUYveXAwoQGmJjZf8C_zbBxA+8E5aquWQaScg@mail.gmail.com> (raw)
In-Reply-To: <202005211942.6E5061433@keescook>

On Fri, May 22, 2020 at 4:43 AM Kees Cook <keescook@chromium.org> wrote:
>
> On Wed, May 20, 2020 at 11:20:10AM -0700, 'Fangrui Song' via Clang Built Linux wrote:
> > In the latest efi tree, ce5e3f909fc0ed67e58367b9c56a54c20a51080b
> > "efi/printf: Add 64-bit and 8-bit integer support",
> > arch/x86/boot/compressed/vmlinux may have an undesired
> > .discard.unreachable section from drivers/firmware/efi/libstub/vsprintf.stub.o
> >
> > .discard.unreachable contains an R_X86_64_PC32 relocation, which will be
> > warned by LLD: a non-SHF_ALLOC section (.discard.unreachable) is not
> > part of the memory image, thus conceptually the distance between a
> > non-SHF_ALLOC and a SHF_ALLOC is not a constant which can be resolved at
> > link time.
> >
> > % ld.lld -m elf_x86_64 -T arch/x86/boot/compressed/vmlinux.lds ... -o arch/x86/boot/compressed/vmlinux
> > ld.lld: warning: vsprintf.c:(.discard.unreachable+0x0): has non-ABS relocation R_X86_64_PC32 against symbol ''
> >
> > Reuse the DISCARDS macro which includes .discard.* to drop .discard.unreachable
> >
> > Reported-by: kbuild test robot <lkp@intel.com>
> > Signed-off-by: Fangrui Song <maskray@google.com>
>
> Yay macro usage! :)
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>

Feel free to add...

   Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # build and boot on
Linux v5.7-rc6+ with Clang and LLD v10.0.1-rc1

...together with one more patches in the x86/boot area:

x86/boot: Correct relocation destination on old linkers

Next run will include:

x86/boot: Add .text.startup to setup.ld (v2)

- Sedat -

[1] https://github.com/llvm/llvm-project/releases/tag/llvmorg-10.0.1-rc1

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 18:20 Fangrui Song
2020-05-20 19:19 ` Arvind Sankar
2020-05-22  2:42 ` Kees Cook
2020-05-22  6:51   ` Sedat Dilek [this message]
2020-05-22 15:54     ` Ard Biesheuvel
2020-05-22 15:57       ` Sedat Dilek
2020-05-22 15:59         ` Ard Biesheuvel

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=CA+icZUU58cY31rUYveXAwoQGmJjZf8C_zbBxA+8E5aquWQaScg@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=ardb@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=maskray@google.com \
    --cc=ndesaulniers@google.com \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.org \
    /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

Linux-EFI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-efi/0 linux-efi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-efi linux-efi/ https://lore.kernel.org/linux-efi \
		linux-efi@vger.kernel.org
	public-inbox-index linux-efi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-efi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git