android_kernel_google_msm/arch/x86/vdso
Jiri Slaby 8418031d08 x86/vdso: Fix the build on GCC5
commit e893286918d2cde3a94850d8f7101cd1039e0c62 upstream.

On gcc5 the kernel does not link:

  ld: .eh_frame_hdr table[4] FDE at 0000000000000648 overlaps table[5] FDE at 0000000000000670.

Because prior GCC versions always emitted NOPs on ALIGN directives, but
gcc5 started omitting them.

.LSTARTFDEDLSI1 says:

        /* HACK: The dwarf2 unwind routines will subtract 1 from the
           return address to get an address in the middle of the
           presumed call instruction.  Since we didn't get here via
           a call, we need to include the nop before the real start
           to make up for it.  */
        .long .LSTART_sigreturn-1-.     /* PC-relative start address */

But commit 69d0627a7f ("x86 vDSO: reorder vdso32 code") from 2.6.25
replaced .org __kernel_vsyscall+32,0x90 by ALIGN right before
__kernel_sigreturn.

Of course, ALIGN need not generate any NOP in there. Esp. gcc5 collapses
vclock_gettime.o and int80.o together with no generated NOPs as "ALIGN".

So fix this by adding to that point at least a single NOP and make the
function ALIGN possibly with more NOPs then.

Kudos for reporting and diagnosing should go to Richard.

Reported-by: Richard Biener <rguenther@suse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1425543211-12542-1-git-send-email-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-06-19 11:40:25 +08:00
..
vdso32 x86/vdso: Fix the build on GCC5 2015-06-19 11:40:25 +08:00
.gitignore x32: Add x32 VDSO support 2012-02-20 12:52:06 -08:00
Makefile x32: Add x32 VDSO support 2012-02-20 12:52:06 -08:00
checkundef.sh
vclock_gettime.c x86-64: Inline vdso clock_gettime helpers 2012-03-23 16:49:35 -07:00
vdso-layout.lds.S
vdso-note.S
vdso.S
vdso.lds.S
vdso32-setup.c Revert "x86-64, modify_ldt: Make support for 16-bit segments a runtime option" 2014-08-07 12:00:10 -07:00
vdso32.S
vdsox32.S x32: Add x32 VDSO support 2012-02-20 12:52:06 -08:00
vdsox32.lds.S x32: Drop non-__vdso weak symbols from the x32 VDSO 2012-02-22 20:40:07 -08:00
vgetcpu.c
vma.c x86_64, vdso: Fix the vdso address randomization algorithm 2015-04-14 17:33:48 +08:00