diff mbox series

[FFmpeg-devel,7/8] lavu/riscv: align functions to 4 bytes

Message ID 20240722201350.53382-1-remi@remlab.net
State New
Headers show
Series [FFmpeg-devel,1/6] lavu/riscv: assembly for zicfilp LPAD | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Rémi Denis-Courmont July 22, 2024, 8:13 p.m. UTC
Currently the start of the byte range for each function is aligned to
4 bytes. But this can lead to situations whence the function is preceded
by a 2-byte C.NOP at the aligned 4-byte boundary. Then the first actual
instruction and the function symbol are only aligned on 2 bytes.

This forcefully disables compression for the alignment and the symbol,
thus ensuring that there is no padding before the function.
---
 libavutil/riscv/asm.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
index 37fd7d3b03..633c93d5fd 100644
--- a/libavutil/riscv/asm.S
+++ b/libavutil/riscv/asm.S
@@ -38,7 +38,6 @@ 
 
         .macro func sym, ext1=, ext2=
             .text
-            .align 2
 
             .option push
             .ifnb \ext1
@@ -51,7 +50,11 @@ 
             .global \sym
             .hidden \sym
             .type   \sym, %function
+            .option push
+            .option norvc
+            .align  2
             \sym:
+            .option pop
 
             .macro endfunc
                 .size   \sym, . - \sym