diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2024-01-16 08:45:26 +0000 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2024-01-18 14:02:19 +0000 |
commit | 1d82a2d933efd49a895873545a46f4945c716654 (patch) | |
tree | d33572a743b452aedba682ce634635570ebebb50 | |
parent | efe4ea2754f5488dd84eb1a76815c1177dc6897c (diff) | |
download | gcc-1d82a2d933efd49a895873545a46f4945c716654.zip gcc-1d82a2d933efd49a895873545a46f4945c716654.tar.gz gcc-1d82a2d933efd49a895873545a46f4945c716654.tar.bz2 |
lto, Darwin: Fix offload section names.
Currently, these section names have wrong syntax for Mach-O.
Although they were added some time ago; recently added tests are
now emitting them leading to new fails on Darwin.
This adds a Mach-O variant for each.
gcc/ChangeLog:
* lto-section-names.h (OFFLOAD_SECTION_NAME_PREFIX,
OFFLOAD_VAR_TABLE_SECTION_NAME, OFFLOAD_FUNC_TABLE_SECTION_NAME,
OFFLOAD_IND_FUNC_TABLE_SECTION_NAME): Provide Mach-O syntax
versions when the object format is Mach-O.
Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
-rw-r--r-- | gcc/lto-section-names.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/lto-section-names.h b/gcc/lto-section-names.h index a743deb..1cdadf3 100644 --- a/gcc/lto-section-names.h +++ b/gcc/lto-section-names.h @@ -25,7 +25,11 @@ along with GCC; see the file COPYING3. If not see name for the functions and static_initializers. For other types of sections a '.' and the section type are appended. */ #define LTO_SECTION_NAME_PREFIX ".gnu.lto_" +#if OBJECT_FORMAT_MACHO +#define OFFLOAD_SECTION_NAME_PREFIX "__GNU_OFFLD_LTO," +#else #define OFFLOAD_SECTION_NAME_PREFIX ".gnu.offload_lto_" +#endif /* Can be either OFFLOAD_SECTION_NAME_PREFIX when we stream IR for offload compiler, or LTO_SECTION_NAME_PREFIX for LTO case. */ @@ -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" #define OFFLOAD_FUNC_TABLE_SECTION_NAME ".gnu.offload_funcs" #define OFFLOAD_IND_FUNC_TABLE_SECTION_NAME ".gnu.offload_ind_funcs" +#endif #endif /* GCC_LTO_SECTION_NAMES_H */ |