[FFmpeg-cvslog] arm: warn/error on movrelx usage problematic with PIC on ELF

Janne Grunau git at videolan.org
Tue Apr 4 22:04:59 EEST 2017


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Fri Nov 18 21:06:40 2016 +0100| [6a1ea4ec932f4fc9fdc00ec51ee070b298ddb35f] | committer: Janne Grunau

arm: warn/error on movrelx usage problematic with PIC on ELF

The warning has false positives but our asm does not trigger it. For
new code false positives can only be avoided by changing the register
allocation.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6a1ea4ec932f4fc9fdc00ec51ee070b298ddb35f
---

 libavutil/arm/asm.S | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
index 4ac0ea2..a791e80 100644
--- a/libavutil/arm/asm.S
+++ b/libavutil/arm/asm.S
@@ -184,6 +184,15 @@ T       ldr             \rd, [\rd]
 .endm
 
 .macro  movrelx         rd,  val, gp
+    .ifc \rd,\gp
+        .error      "movrelx needs two distinct registers"
+    .endif
+    .ifc \rd\()_\gp,r12_
+        .warning    "movrelx rd=\rd without explicit set gp"
+    .endif
+    .ifc \rd\()_\gp,ip_
+        .warning    "movrelx rd=\rd without explicit set gp"
+    .endif
 #if CONFIG_PIC && defined(__ELF__)
     .ifnb \gp
       .if .Lpic_gp



More information about the ffmpeg-cvslog mailing list