@@ -310,22 +310,21 @@ Error relocateOffloadSection(const ArgList &Args, StringRef Output) {
310310 // Remove the old .llvm.offloading section to prevent further linking.
311311 ObjcopyArgs.emplace_back (" --remove-section" );
312312 ObjcopyArgs.emplace_back (" .llvm.offloading" );
313- for (StringRef Prefix : {" omp" , " cuda" , " hip" }) {
314- auto Section = (Prefix + " _offloading_entries" ).str ();
315- // Rename the offloading entires to make them private to this link unit.
316- ObjcopyArgs.emplace_back (" --rename-section" );
317- ObjcopyArgs.emplace_back (
318- Args.MakeArgString (Section + " =" + Section + Suffix));
319-
320- // Rename the __start_ / __stop_ symbols appropriately to iterate over the
321- // newly renamed section containing the offloading entries.
322- ObjcopyArgs.emplace_back (" --redefine-sym" );
323- ObjcopyArgs.emplace_back (Args.MakeArgString (" __start_" + Section + " =" +
324- " __start_" + Section + Suffix));
325- ObjcopyArgs.emplace_back (" --redefine-sym" );
326- ObjcopyArgs.emplace_back (Args.MakeArgString (" __stop_" + Section + " =" +
327- " __stop_" + Section + Suffix));
328- }
313+ StringRef Prefix = " llvm" ;
314+ auto Section = (Prefix + " llvm_offload_entries" ).str ();
315+ // Rename the offloading entires to make them private to this link unit.
316+ ObjcopyArgs.emplace_back (" --rename-section" );
317+ ObjcopyArgs.emplace_back (
318+ Args.MakeArgString (Section + " =" + Section + Suffix));
319+
320+ // Rename the __start_ / __stop_ symbols appropriately to iterate over the
321+ // newly renamed section containing the offloading entries.
322+ ObjcopyArgs.emplace_back (" --redefine-sym" );
323+ ObjcopyArgs.emplace_back (Args.MakeArgString (" __start_" + Section + " =" +
324+ " __start_" + Section + Suffix));
325+ ObjcopyArgs.emplace_back (" --redefine-sym" );
326+ ObjcopyArgs.emplace_back (Args.MakeArgString (" __stop_" + Section + " =" +
327+ " __stop_" + Section + Suffix));
329328
330329 if (Error Err = executeCommands (*ObjcopyPath, ObjcopyArgs))
331330 return Err;
0 commit comments