This is an archive of the discontinued LLVM Phabricator instance.

[Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker
ClosedPublic

Authored by sdmitriev on Sep 25 2019, 8:33 PM.

Details

Summary

Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from “.omp.offloading_entries” to “omp_offloading_entries” to use this feature.

This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943).

Diff Detail

Repository
rL LLVM

Event Timeline

sdmitriev created this revision.Sep 25 2019, 8:33 PM
JonChesterfield accepted this revision.Sep 26 2019, 2:43 AM

Looks great, thanks.

This revision is now accepted and ready to land.Sep 26 2019, 2:43 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2019, 12:59 PM

Heads up that this change broke compatibility with old binaries. Not sure if that is something worth to fix, but it should probably at least be spelt out somewhere...

openmp/trunk/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp
53

This is an incompatible change, making it impossible to load old binaries because their section name doesn't match :-(