summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2013-04-23 08:08:30 -0700
committerTom Stellard <[email protected]>2013-04-24 16:51:25 -0700
commitd9a32b84e38fda935032338a0a4ae9438d48108d (patch)
treee780677a459ee958b2604861fa1e71bbcb27ddaf /src
parent5bbeae7a3d3be17d44b1bc851872a107a75c393b (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeon/radeon_llvm_emit.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
index 5b770d0fd05..55dad9b983c 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());