From: Carlos S. de La L. <car...@ur...> - 2011-12-19 11:00:05
|
>> I think we can reuse AMD one (just uses ELF sections for different >> binaries) as it is well specified. > > IIRC, the AMD's ELF files store the LLVM bitcode and the AMD-IL (both IRs), > not the final binary, right? Also the final binary, optionally. > The OpenCL API for fetching and loading the program binaries is multi-device. > Thus the format should not be tied to an architecture as it can contain the > same kernels compiled for multiple devices. What does this mean? > I'm not sure if the ELF provides some benefits for this scenario. We need > basically a format that stores multiple independent (sometimes ELF?) > binaries for the compiled program(s) and the LLVM bitcode as a separate one. > The compiled programs should be quickly loadable to the dynamic linker, > preferably without extracting them first to a separate file. Can ELF > support this nicely? The stored binaries (same kernels compiled for > multiple dimensions) might contain clashing symbols, AFAIU so they should > be stored as "binary blob sections" in ELF, not as "program sections" with > linkage/relocation info? You know ELF better than I do... ELF is used as a trick here. It is not real "ELF". You just get the binary/bytecode/source file/whatever and put it into an ELF section. No relocations or anything at that level, the ELF is used only as a way to put all the files together. If some of the binaries are ELF, then the whole ELF would be inside of a section (you would need to "objcopy" it out, and then you would get a real ELF). http://developer.amd.com/sdks/AMDAPPSDK/assets/AMD_Accelerated_Parallel_Processing_OpenCL_Programming_Guide.pdf Any other option (tar/zip/ELF/whatever) would do the same, but as this is documented and used on a OpenCL SDK I would suggest doing the same. > What about FatELF? If it provides advantages in our use case and it is widespread enough, why not. But if it does not the then using ELF (not real ELF, but ELF as in AMD SDK "BIF" format) is probably easier for implementation (just pack the files together). Carlos |