[Openmp-commits] [PATCH] D64943: [Clang][OpenMP offload] Eliminate use of OpenMP linker script

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 12 02:57:33 PDT 2019

JonChesterfield added a comment.

I'm on board with getting rid of the linker script. Gold's limited support for that seems conclusive.

I believe the current script does two things:
1/ takes a binary and embeds it in a section named .omp_offloading.amdgcn-amd-amdhsa
2/ provides start/end symbols for that section and for .omp_offloading.entries.

2/ is discussed above.
1/ can be implemented as a call to (llvm-)objcopy

> If binary is used as the value for --input-target, the input file will be embedded as a data section in an ELF relocatable object, with symbols _binary_<file_name>_start, _binary_<file_name>_end, and _binary_<file_name>_size representing the start, end and size of the data, where <file_name> is the path of the input file as specified on the command line with non-alphanumeric characters converted to _.

I think dropping the linker script means that cmake will need to invoke an extra executable. As far as I can see, that tool can be objcopy instead of clang-offload-wrapper.

Does this diff mix getting rid of the linker script with other changes? E.g. it looks like the metadata generation is moving from clang to the new tool, but that seems orthogonal to dropping the linker script.



More information about the Openmp-commits mailing list