]> granicus.if.org Git - libvpx/commitdiff
Use .text instead of .rodata on macho
authorJohann <johannkoenig@google.com>
Thu, 30 Jul 2015 16:18:36 +0000 (09:18 -0700)
committerJohann <johannkoenig@google.com>
Fri, 7 Aug 2015 23:43:31 +0000 (16:43 -0700)
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: I58c18a53e503f093ee268451698c5761e6c32540

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

index 6997e099275978f6565fd919a8df810b2fcb2090..013e085218d8856d11b096fb4f1b035797595734 100644 (file)
@@ -17,3 +17,4 @@ Catch all elf formats for 'hidden' status and SECTION notes.
 Avoid 'amdnop' when building with nasm.
 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 fb0b389842bc05a84ea6135cd4b342603756c9e0..840a5190d4e0b393e824bc83abddd307ed33807c 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
 
 %macro SECTION_TEXT 0-1 16