arm: Clear the gp register alias at the end of functions
authorMartin Storsjö <martin@martin.st>
Thu, 10 Nov 2016 11:23:38 +0000 (13:23 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 10 Nov 2016 12:01:04 +0000 (14:01 +0200)
We reset .Lpic_gp to zero at the start of each function, which means
that the logic within movrelx for clearing gp when necessary will
be missed.

This fixes using movrelx in different functions with a different
helper register.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavutil/arm/asm.S

index 1a048b5..4ac0ea2 100644 (file)
@@ -83,6 +83,9 @@ ELF     .section .note.GNU-stack,"",%progbits @ Mark stack as non-executable
         put_pic         %(.Lpic_idx - 1)
         .noaltmacro
       .endif
+      .if .Lpic_gp
+        .unreq          gp
+      .endif
 ELF     .size   \name, . - \name
 FUNC    .endfunc
         .purgem endfunc