Hi Iain, hello world,
Thomas Schwinge wrote:
On 2024-01-16T15:00:16+0000, Iain Sandoe <iains....@gmail.com> wrote:
...
diff --git a/gcc/lto-section-names.h b/gcc/lto-section-names.h
index a743deb4efb..1cdadf36ec0 100644
--- a/gcc/lto-section-names.h
+++ b/gcc/lto-section-names.h
...
@@ -35,8 +39,14 @@ extern const char *section_name_prefix;
#define LTO_SEGMENT_NAME "__GNU_LTO"
+#if OBJECT_FORMAT_MACHO
+#define OFFLOAD_VAR_TABLE_SECTION_NAME "__GNU_OFFLOAD,__vars"
+#define OFFLOAD_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__funcs"
+#define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME "__GNU_OFFLOAD,__ind_fns"
+#else
#define OFFLOAD_VAR_TABLE_SECTION_NAME ".gnu.offload_vars"
...
Just to note that, per my understanding, this will require corresponding
changes elsewhere, once you attempt to actually enable offloading
compilation for Darwin (which -- ;-) I suspect -- is not on your agenda
right now):
For instance also in MOLD:
https://github.com/rui314/mold/blob/50bdf39ba57e29386de28bd0c303035e626fa29c/elf/input-files.cc#L244
if ((shdr.sh_flags & SHF_EXCLUDE) &&
name.starts_with(".gnu.offload_lto_.symtab.")) {
this->is_gcc_offload_obj = true;
continue;
}
Tobias