]> granicus.if.org Git - libvpx/commitdiff
x86inc.asm: use .text on march32
authorJohann <johannkoenig@google.com>
Thu, 2 Apr 2020 01:47:30 +0000 (10:47 +0900)
committerJohann <johannkoenig@google.com>
Thu, 2 Apr 2020 02:02:23 +0000 (11:02 +0900)
Reapply 9679be4bc. The read only sections are getting stripped on some
OS X builds. As a result, random data is used in place of the intended
tables.

BUG=webm:1679

Change-Id: Ifb17acbed73df4b9949a8badae2d9305a3073b83

third_party/x86inc/README.libvpx_new
third_party/x86inc/x86inc.asm_new

index af37bb876cc41cd54b4b7f709fabba49131a9250..7dfa9854b3509c498b8f26de2ae35d48e3a998c8 100644 (file)
@@ -13,3 +13,4 @@ Prefix functions with vpx by default.
 Manage name mangling (prefixing with '_') manually because 'PREFIX' does not
   exist in libvpx.
 Copy PIC 'GLOBAL' macros from x86_abi_support.asm
+Use .text instead of .rodata on macho to avoid broken tables in PIC mode.
index 72092d3ba0e78e9d469950efcd82e8bca9b61320..551285aa38be4d9270274f3fceb3dbead9af8545 100644 (file)
     %define mangle(x) x
 %endif
 
+; In some instances macho32 tables get misaligned when using .rodata.
+; When looking at the disassembly it appears that the offset is either
+; correct or consistently off by 90. Placing them in the .text section
+; works around the issue. It appears to be specific to the way libvpx
+; handles the tables.
 %macro SECTION_RODATA 0-1 16
     %ifidn __OUTPUT_FORMAT__,win32
         SECTION .rdata align=%1
     %elif WIN64
         SECTION .rdata align=%1
+    %elifidn __OUTPUT_FORMAT__,macho32
+        SECTION .text align=%1
+        fakegot:
     %else
         SECTION .rodata align=%1
     %endif