mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fangrui Song <maskray@google.com>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: clang-built-linux@googlegroups.com, x86@kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/1] x86/boot: lld fix
Date: Wed, 20 May 2020 19:12:17 -0700	[thread overview]
Message-ID: <20200521021217.yqsulqwfrhqorp7p@google.com> (raw)
In-Reply-To: <20200520233357.GA4160490@rani.riverdale.lan>

On 2020-05-20, Arvind Sankar wrote:
>On Wed, May 20, 2020 at 06:56:53PM -0400, Arvind Sankar wrote:
>> arch/x86/boot/setup.elf currently has an orphan section .text.startup,
>> and lld git as of ebf14d9b6d8b is breaking on 64-bit due to what seems
>> to be a change in behavior on orphan section placement (details in patch
>> commit message).
>>
>> I'm not sure if this was an intentional change in lld, but it seems like
>> a good idea to explicitly include .text.startup anyway.
>>
>> Arvind Sankar (1):
>>   x86/boot: Add .text.startup to setup.ld
>>
>>  arch/x86/boot/setup.ld | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --
>> 2.26.2
>>

I found your PATCH 1/1 on https://lkml.org/lkml/2020/5/20/1491 

-	.text		: { *(.text) }
+	.text		: { *(.text.startup) *(.text) }

The LLD behavior change was introduced in
https://reviews.llvm.org/D75225 (will be included in 11.0.0)
It was intended to match GNU ld.

But yes, orphan section placement is still different in the two linkers.

Placing .text.startup before .text seems good.
In GNU ld's internal linker script (ld --verbose),
.text.startup is placed before .text

Reviewed-by: Fangrui Song <maskray@google.com>

  reply	other threads:[~2020-05-21  2:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20 22:56 Arvind Sankar
2020-05-20 22:56 ` [PATCH 1/1] x86/boot: Add .text.startup to setup.ld Arvind Sankar
2020-05-20 23:33 ` [PATCH 0/1] x86/boot: lld fix Arvind Sankar
2020-05-21  2:12   ` Fangrui Song [this message]
2020-05-21 15:20     ` Arvind Sankar
2020-05-21 15:24     ` [PATCH v2] x86/boot: Add .text.startup to setup.ld Arvind Sankar

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=20200521021217.yqsulqwfrhqorp7p@google.com \
    --to=maskray@google.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --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
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

all inboxes | Powered by JetHome®