]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix sparc libm when all of glibc is built with -frounding-math.
authorDavid S. Miller <davem@davemloft.net>
Mon, 7 May 2012 23:54:11 +0000 (16:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 May 2012 23:54:11 +0000 (16:54 -0700)
[BZ #14074]
* sysdeps/sparc/sysdep.h (SPARC_PIC_THUNK_CALL): New macro.
(SETUP_PIC_REG): Use it.
(SETUP_PIC_REG_LEAF): Use it.

ChangeLog
sysdeps/sparc/sysdep.h

index b80b4856fc99572bd63f8ec2c7552d46da90da16..ab0b7cfa62ea6db9c6ae61716c53b87b6ad082db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-07  David S. Miller  <davem@davemloft.net>
+
+       [BZ #14074]
+       * sysdeps/sparc/sysdep.h (SPARC_PIC_THUNK_CALL): New macro.
+       (SETUP_PIC_REG): Use it.
+       (SETUP_PIC_REG_LEAF): Use it.
+
 2012-05-07  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #13885]
index 2702620be6f171af99cb060fb97c7a9e2150ec9b..bcffec94f0d0f57f1de32367cfec2a13cd689299 100644 (file)
@@ -58,21 +58,34 @@ __sparc_get_pc_thunk.reg:                                           \
        .previous;                                                      \
        .endif;
 
-/* Even when v9 we use a call sequence instead of using "rd %pc" because
+/* The "-4" and "+4" offsets against _GLOBAL_OFFSET_TABLE_ are
+   critical since they represent the offset from the thunk call to the
+   instruction containing the _GLOBAL_OFFSET_TABLE_ reference.
+   Therefore these instructions cannot be moved around without
+   appropriate adjustments to those offsets.
+
+   Furthermore, these expressions are special in another regard.  When
+   the assembler sees a reference to _GLOBAL_OFFSET_TABLE_ inside of
+   a %hi() or %lo(), it emits a PC-relative relocation.  This causes
+   R_SPARC_HI22 to turn into R_SPARC_PC22, and R_SPARC_LO10 to turn into
+   R_SPARC_PC10, respectively.
+
+   Even when v9 we use a call sequence instead of using "rd %pc" because
    RDPC is extremely expensive and incurs a full pipeline flush.  */
 
-#define SETUP_PIC_REG(reg)                                             \
-       SPARC_PIC_THUNK(reg)                                            \
+#define SPARC_PIC_THUNK_CALL(reg)                                      \
        sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg;                   \
        call    __sparc_get_pc_thunk.reg;                               \
         or     %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg;
 
+#define SETUP_PIC_REG(reg)                                             \
+       SPARC_PIC_THUNK(reg)                                            \
+       SPARC_PIC_THUNK_CALL(reg)
+
 #define SETUP_PIC_REG_LEAF(reg, tmp)                                   \
        SPARC_PIC_THUNK(reg)                                            \
-       sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg;                   \
        mov     %o7, %##tmp;                                            \
-       call    __sparc_get_pc_thunk.reg;                               \
-        or     %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg;           \
+       SPARC_PIC_THUNK_CALL(reg);                                      \
        mov     %##tmp, %o7;
 
 #undef ENTRY