[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
Wed Sep 11 14:02:33 PDT 2019

JonChesterfield added a comment.

In D64943#1666849 <https://reviews.llvm.org/D64943#1666849>, @sdmitriev wrote:

> In D64943#1666636 <https://reviews.llvm.org/D64943#1666636>, @JonChesterfield wrote:
> > I'm not sure copying the crtbegin/crtend mechanism from the early days of C runtime is ideal. Since the data is stored in a common section anyway, please could we rename it to __omp_offloading_entries in which case the linker will provide start/end symbols automatically?
> Well, I never said that it is an ideal solution, but it is a known mechanism that works well in many cases and can also be reused for the offloading entry table.
>  I do not fully understand your suggestion for renaming entries section, how it will help with providing start/end symbols for the entries. Can you please provide more details?

Given a custom elf section with a C identifier as a name, the linker will provide definitions of `__start_name`/`__stop_name` to satisfy unresolved symbols. I don't believe this occurs if the section name is not a C identifier, e.g. contains a period. So unless I've misinterpreted the purpose of the two object files, they can be removed in exchange for renaming the section.



More information about the Openmp-commits mailing list