]> sourceware.org Git - glibc.git/commitdiff
MIPS: Use R_MICROMIPS_JALR rather than R_MIPS_JALR in microMIPS code
authorMaciej W. Rozycki <macro@imgtec.com>
Wed, 23 Nov 2016 12:39:39 +0000 (12:39 +0000)
committerMaciej W. Rozycki <macro@imgtec.com>
Wed, 23 Nov 2016 18:23:35 +0000 (18:23 +0000)
In a microMIPS compilation of `.init' code use the R_MICROMIPS_JALR
relocation intended for PIC call relaxation in microMIPS code rather
than the corresponding R_MIPS_JALR relocation meant for regular MIPS
code only.

* sysdeps/mips/mips32/crti.S (JALR_RELOC): New macro.
(_init): Use it in place of hardcoded R_MIPS_JALR.
* sysdeps/mips/mips64/n32/crti.S (JALR_RELOC): New macro.
(_init): Use it in place of hardcoded R_MIPS_JALR.
* sysdeps/mips/mips64/n64/crti.S (JALR_RELOC): New macro.
(_init): Use it in place of hardcoded R_MIPS_JALR.

ChangeLog
sysdeps/mips/mips32/crti.S
sysdeps/mips/mips64/n32/crti.S
sysdeps/mips/mips64/n64/crti.S

index 963bf2af638ddbe9fc03666317c563587c1d321c..3063bd06afae469f135b0cb0595492132ba2964c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-11-23  Maciej W. Rozycki  <macro@imgtec.com>
+
+       * sysdeps/mips/mips32/crti.S (JALR_RELOC): New macro.
+       (_init): Use it in place of hardcoded R_MIPS_JALR.
+       * sysdeps/mips/mips64/n32/crti.S (JALR_RELOC): New macro.
+       (_init): Use it in place of hardcoded R_MIPS_JALR.
+       * sysdeps/mips/mips64/n64/crti.S (JALR_RELOC): New macro.
+       (_init): Use it in place of hardcoded R_MIPS_JALR.
+
 2016-11-23  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #20787]
index dfbbdc4f8f78b10834b24dd3964126a5892e67b1..a801f288206260bef72aa323f73680ce0a4c20ce 100644 (file)
 
 #include <libc-symbols.h>
 
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
 #ifndef PREINIT_FUNCTION
 # define PREINIT_FUNCTION __gmon_start__
 #endif
@@ -71,13 +77,13 @@ _init:
        lw $2,%got(PREINIT_FUNCTION)($28)
        beq $2,$0,.Lno_weak_fn
        lw $25,%call16(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
        .insn
 #else
        lw $25,%got(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 #endif
 
index afe6d8edaae8db8f0437872a90c6a44a6b09d002..376fa53c97b40cbc7406dec32897af1bfed63497 100644 (file)
 
 #include <libc-symbols.h>
 
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
 #ifndef PREINIT_FUNCTION
 # define PREINIT_FUNCTION __gmon_start__
 #endif
@@ -71,13 +77,13 @@ _init:
        lw $2,%got_disp(PREINIT_FUNCTION)($28)
        beq $2,$0,.Lno_weak_fn
        lw $25,%call16(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
        .insn
 #else
        lw $25,%got_disp(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 #endif
 
index 4049d29290ce1e3f271f48f347bdf7ea10f408c0..e7fdea453b6b37f7e3f4b650f95ecca0b402c56e 100644 (file)
 
 #include <libc-symbols.h>
 
+#ifdef __mips_micromips
+# define JALR_RELOC R_MICROMIPS_JALR
+#else
+# define JALR_RELOC R_MIPS_JALR
+#endif
+
 #ifndef PREINIT_FUNCTION
 # define PREINIT_FUNCTION __gmon_start__
 #endif
@@ -71,13 +77,13 @@ _init:
        ld $2,%got_disp(PREINIT_FUNCTION)($28)
        beq $2,$0,.Lno_weak_fn
        ld $25,%call16(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 .Lno_weak_fn:
        .insn
 #else
        ld $25,%got_disp(PREINIT_FUNCTION)($28)
-       .reloc 1f,R_MIPS_JALR,PREINIT_FUNCTION
+       .reloc 1f,JALR_RELOC,PREINIT_FUNCTION
 1:     jalr $25
 #endif
 
This page took 0.175367 seconds and 5 git commands to generate.