Technically, this patch is stand alone, but conceptually it based on the submitted but not reviewed patch: "[Patch] OpenMP: Support reverse offload (middle end part)" https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598662.html With that patch, for reverse offloads ('omp target device(ancestor:1)'), calls like the following are added: GOMP_target_ext (-2 /* initial device */, omp_fn.1 where 'omp_fn.1' on nonhost devices a stub function just required for looking up the host function pointer via the offload_funcs table. The attached patch prepare for reverse-offload device->host function-address lookup by requesting (if needed) the on-device address. OK for mainline? Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955