]> granicus.if.org Git - libvpx/commitdiff
Use .text instead of .rodata on macho
authorJohann <johannkoenig@google.com>
Thu, 18 Feb 2016 02:25:09 +0000 (18:25 -0800)
committerJohann <johannkoenig@google.com>
Thu, 18 Feb 2016 02:45:40 +0000 (18:45 -0800)
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.

Change-Id: I4629c90d9e0ae4d4efc193a93be6fb93809ae895

third_party/x86inc/README.libvpx
third_party/x86inc/x86inc.asm

index 6fe3429d65016f515eb0ea5b78804e33f7f4f590..e8cbbf8893c74e23389391cf91a7273552845a2d 100644 (file)
@@ -15,3 +15,4 @@ Manage name mangling (prefixing with '_') manually because 'PREFIX' does not
 Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
 Set 'private_extern' visibility for macho targets.
 Copy PIC 'GLOBAL' macros from x86_abi_support.asm
+Use .text instead of .rodata on macho to avoid broken tables in PIC mode.
index e28348eefb557ee0d24042163d14344a8b7e740d..9aaa0e5ad010423529beadc14684322096918cb5 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
-    SECTION .rodata align=%1
+    %ifidn __OUTPUT_FORMAT__,macho32
+        SECTION .text align=%1
+        fakegot:
+    %else
+        SECTION .rodata align=%1
+    %endif
 %endmacro
 
 ; PIC macros are copied from vpx_ports/x86_abi_support.asm. The "define PIC"