From 11c88185580f0e092c0fb623ac94a60f526dc919 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 27 Jun 2011 16:08:46 +1000 Subject: [PATCH] 32 bit only builds one elf, not an elf in an elf, so account for it to be able to bfi int patch properly. --- ocl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ocl.c b/ocl.c index 77968357..0a2561b8 100644 --- a/ocl.c +++ b/ocl.c @@ -426,18 +426,22 @@ retry: * back and find the 2nd incidence of \x7ELF (rewind by one * from ELF) and then patch the opcocdes */ if (!advance(&w, &remaining, ".text")) - {patchbfi = false; goto retry;} + {patchbfi = false; goto retry;} w++; remaining--; - if (!advance(&w, &remaining, ".text")) - {patchbfi = false; goto retry;} + if (!advance(&w, &remaining, ".text")) { + /* 32 bit builds only one ELF */ + w--; remaining++; + } memcpy(&start, w + 285, 4); memcpy(&length, w + 289, 4); w = binaries[gpu]; remaining = binary_sizes[gpu]; if (!advance(&w, &remaining, "ELF")) - {patchbfi = false; goto retry;} + {patchbfi = false; goto retry;} w++; remaining--; - if (!advance(&w, &remaining, "ELF")) - {patchbfi = false; goto retry;} + if (!advance(&w, &remaining, "ELF")) { + /* 32 bit builds only one ELF */ + w--; remaining++; + } w--; remaining++; w += start; remaining -= start; if (opt_debug)