From: Carlos S. de La L. <car...@ur...> - 2011-12-19 12:27:03
|
>> Again, ELF is used in BIF just as a wrapper, so you can create a >> ".myownstuff" section and put whatever you want inside. There is no need >> for it to be in the ".text" > > I know. But then, how I see it, ELF is just "abused" as an archive format here > without actual benefits to generic file archive formats. If you do not > use the executable and linking related info but treat all contents as > "unknown binary blobs" with some "custom metadata", what's the point of > using such a format? None, it is just a format, any is OK as long as it is simple enough (thats why I prefer ELF over FatELF, but any other simpler form would be even better). > If we use ELF as the "OpenCL binary format" I think we should keep the binary > program dlopenable (in .text, .rodata, .data) to have the benefits from the > standard format (at least in operating systems that support ELF). This means > (AFAIU) compiling the multiple versions of the kernel to the same .text with > different function names. Or, if something simpler is chosen it could be a > simple wrapper with quickly extractable final files (even tar could work or even our own simple format). Agreed, the directly loadable ELF would be the nicest. But how to support this in a way it does not clash with systems where the loadable libraries are not ELF? One option is to let binary generation solely to the driver so I can take care, but even some drivers (native/pthread) might have to be ELF and non-ELF depending on the system (darwin is not ELF, for example). > The alternative could be to define a simplistic custom wrapper format that > wraps in the final binaries and the bc. It would not care of the format of > the final binaries (thus the OpenCL binary container *contents* would be > platform-specific, but the container itself not) and would store enough > metadata for choosing the correct final binary based on the dimensions. That was my first thought. I think it is the simplest way. Any format capable of storing several files/buffers together will do. I said ELF cause BIF is defined as ELF, but any format will do. I suspect AMD chose ELF cause they had to put the ELF libraries there anyways (the binary inside the .text is again ELF in their case). But I would go for any sensible format (existing one, no need to reinvent the wheel with a custom format). Carlos |