From: Tom Stellard Date: Tue, 23 Apr 2013 15:08:30 +0000 (-0700) Subject: radeon/llvm: Fix segfault with a specifc libelf implementation X-Git-Tag: mesa-9.2.1~1590 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F6188%2F1;p=platform%2Fupstream%2Fmesa.git radeon/llvm: Fix segfault with a specifc libelf implementation The libelf implementation that is distributed here: http://www.mr511.de/software/english.html requires calling elf_version() prior to calling elf_memory() Tested-by: Michel Dänzer --- diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp index 5b770d0..55dad9b 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp @@ -159,6 +159,10 @@ radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary, char *elf_buffer; + /* One of the libelf implementations (http://www.mr511.de/software/english.htm) + * requires calling elf_version() before elf_memory(). + */ + elf_version(EV_CURRENT); elf_buffer = (char*)malloc(data.length()); memcpy(elf_buffer, data.c_str(), data.length());