]> granicus.if.org Git - libx264/commitdiff
checkasm: Fix compilation on hardened x86-64 ELF systems
authorHenrik Gramner <henrik@gramner.com>
Fri, 24 Mar 2017 21:27:42 +0000 (22:27 +0100)
committerHenrik Gramner <henrik@gramner.com>
Wed, 29 Mar 2017 15:13:47 +0000 (17:13 +0200)
Normal PC-relative relocations cannot be used for resolving the address of
external symbols on systems where ASLR results in the offset being larger
than 32 bits. We are required to to go through the PLT instead.

tools/checkasm-a.asm

index 34d5bebebb5125be575428a43dc74298e785e9b1..d1da9b7900bdcc5b26403ead138307efbf390237 100644 (file)
@@ -153,7 +153,11 @@ cglobal checkasm_call, 2,15,16,max_args*8+8
     mov  r9, rax
     mov r10, rdx
     lea  r0, [error_message]
+%if FORMAT_ELF
+    call puts wrt ..plt
+%else
     call puts
+%endif
     mov  r1, [rsp+max_args*8]
     mov  dword [r1], 0
     mov  rdx, r10