arm: Error out if movrelx is invoked with bad register parameters

Message ID
State Superseded
Headers show

Commit Message

Martin Storsjö Nov. 13, 2016, 10:24 p.m.
Check these constraints even for non-pic-elf configurations, to
catch the issues without having to build/test a pic-elf configuration
to find out.
This would have caught the issue in the vp9mc, without actually
having to test a pic configuration.
 libavutil/arm/asm.S | 8 ++++++++
 1 file changed, 8 insertions(+)


diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
index 4ac0ea2..55aa5ff 100644
--- a/libavutil/arm/asm.S
+++ b/libavutil/arm/asm.S
@@ -184,6 +184,14 @@  T       ldr             \rd, [\rd]
 .macro  movrelx         rd,  val, gp
+    .ifc \rd,r12
+      .ifb \gp
+        .error          "movrelx rd=r12, needs a manually set gp"
+      .endif
+    .endif
+    .ifc \gp,\rd
+        .error          "movrelx rd=gp doesn't work"
+    .endif
 #if CONFIG_PIC && defined(__ELF__)
     .ifnb \gp
       .if .Lpic_gp