shithub: opus

Download patch

ref: c5a84df8fdaaeb383401362f3ae57224d10ce300
parent: feabcdc6a4e81baedbf94b06cd07bf356b3c8486
author: Mark Harris <[email protected]>
date: Sat Feb 4 11:57:41 EST 2017

arm2gnu.pl: Fix GNU ARM .type directive

Broken by 76e831d.  Without the .type directive, SIGILL may be produced
if the C code is compiled in Thumb mode, because the compiler may assume
that the asm symbol is also Thumb and call it using a BL instruction.

--- a/celt/arm/arm2gnu.pl
+++ b/celt/arm/arm2gnu.pl
@@ -164,11 +164,11 @@
         $prefix = "";
         if ($proc)
         {
-            $prefix = $prefix.sprintf("\t.type\t%s, %%function; ",$proc) unless ($apple);
+            $prefix = $prefix.sprintf("\t.type\t%s, %%function", $proc) unless ($apple);
             # Make sure we $prefix isn't empty here (for the $apple case).
             # We handle mangling the label here, make sure it doesn't match
             # the label handling below (if $prefix would be empty).
-            $prefix = "; ";
+            $prefix = $prefix."; ";
             push(@proc_stack, $proc);
             s/^[A-Za-z_\.]\w+/$symprefix$&:/;
         }