This is the mail archive of the
mailing list for the binutils project.
Re: [committed, PATCH] Add -mshared option to x86 ELF assembler
- From: Ingo Molnar <mingo at kernel dot org>
- To: Andy Lutomirski <luto at amacapital dot net>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, X86 ML <x86 at kernel dot org>, "linux-kernel at vger dot kernel dot org" <linux-kernel at vger dot kernel dot org>, Markus Trippelsdorf <markus at trippelsdorf dot de>, Binutils <binutils at sourceware dot org>, Andy Lutomirski <luto at kernel dot org>, Linus Torvalds <torvalds at linux-foundation dot org>, Greg Kroah-Hartman <gregkh at linuxfoundation dot org>
- Date: Tue, 2 Jun 2015 09:41:12 +0200
- Subject: Re: [committed, PATCH] Add -mshared option to x86 ELF assembler
- Authentication-results: sourceware.org; auth=none
- References: <20150515103414 dot GA20518 at intel dot com> <20150601083214 dot GA381 at x4> <CAMe9rOrdqc1v7Dzm3T=CO2a7mVNypOXkAZMFxRMJwwcu61jxGQ at mail dot gmail dot com> <CALCETrUsp+B1SZAj7v4U1aYQKkaisMbSeSg2yevHXGJyTQcM=g at mail dot gmail dot com>
* Andy Lutomirski <email@example.com> wrote:
> On Mon, Jun 1, 2015 at 4:05 AM, H.J. Lu <firstname.lastname@example.org> wrote:
> > On Mon, Jun 1, 2015 at 1:32 AM, Markus Trippelsdorf
> > <email@example.com> wrote:
> >> On 2015.05.15 at 03:34 -0700, H.J. Lu wrote:
> >>> This patch adds -mshared option to x86 ELF assembler. By default,
> >>> assembler will optimize out non-PLT relocations against defined non-weak
> >>> global branch targets with default visibility. The -mshared option tells
> >>> the assembler to generate code which may go into a shared library
> >>> where all non-weak global branch targets with default visibility can
> >>> be preempted. The resulting code is slightly bigger. This option
> >>> only affects the handling of branch instructions.
> >>> This Linux kernel patch is needed to create a working x86 Linux kernel if
> >>> it hasn't been applied:
> >>> diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
> >>> index ae6588b..b91a00c 100644
> >>> --- a/arch/x86/kernel/head_64.S
> >>> +++ b/arch/x86/kernel/head_64.S
> >>> @@ -339,8 +339,8 @@ early_idt_handlers:
> >>> i = i + 1
> >>> .endr
> >>> -/* This is global to keep gas from relaxing the jumps */
> >>> -ENTRY(early_idt_handler)
> >>> +/* This is weak to keep gas from relaxing the jumps */
> >>> +WEAK(early_idt_handler)
> >>> cld
> >> Have you posted the patch to LKML already?
> >> (I hit this issue today and it took me a while to figure out the cause.)
> > A kernel patch will be checked in soon.
> It already is:
> It's currently queued for 4.2.
> Ingo, would it make sense to promote this to 4.1? It's definitely a violation
> of the "no development after the merge window" rule, but it's sort of a build
> fix. [...]
Yeah, agreed - the commit was problem-free in testing, so I've cherry-picked it
over into tip:x86/urgent and will push it to Linus for v4.1.