On Fri, Feb 14, 2014 at 04:01:46PM +0100, Bernd Schmidt wrote: > What I'm currently trying to do is to use get_file_function_name, > which should provide a unique string that can be used to look up an > offloaded function. That was suggested by Nathan Sidwell, I'd > forgotten that such a function existed. I haven't actually given > thought to whether that'll be unique across multiple DSOs, but as > long as we also pass a value to the libgomp registration function > that is unique per DSO, that shouldn't really matter - we should be > able to reliably look up a function given these two keys.
get_file_function_name is very problematic, it is not unique across DSOs, and relies on -frandom-seed which user can tweak and even without tweaking can have collisions in, if we can avoid it at all, we should. Not to mention that strings, especially get_file_function_name based ones, aren't really short and will occupy much more space than the tables. I still don't see what you find wrong on the approach with host/target address arrays, if you are afraid something will reorder the arrays (but, what would do that), one can insert indexes into both arrays as well, which the linker can fill in and you can then verify. Jakub