From ca5b6a74a70924e513ae1b1a3f8718eb16ca60f2 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Sat, 9 Aug 2014 18:45:55 -0700 Subject: [PATCH] Fix our x86 PIC_PROLOGUE. The old definition only worked for functions that didn't use numbered local labels. Upstream uses '666' not only as some kind of BSD in-joke, but also because there's little likelihood of any function having labels that high. There's a wider question about whether we actually want to go via the PLT at all in this code, but that's a question for another day. (cherry-pick of 72d7e667c7e926cb120c4edb53cbf74c652ab915.) Bug: 16906712 Change-Id: I3cd8ecc448b33f942bb6e783931808ef39091489 --- libc/arch-x86/include/machine/asm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/arch-x86/include/machine/asm.h b/libc/arch-x86/include/machine/asm.h index bf77525ee..672493d5d 100644 --- a/libc/arch-x86/include/machine/asm.h +++ b/libc/arch-x86/include/machine/asm.h @@ -39,10 +39,10 @@ #define PIC_PROLOGUE \ pushl %ebx; \ - call 1f; \ -1: \ + call 666f; \ +666: \ popl %ebx; \ - addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx + addl $_GLOBAL_OFFSET_TABLE_+[.-666b], %ebx #define PIC_EPILOGUE \ popl %ebx #define PIC_PLT(x) x@PLT