diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-10-23 14:09:17 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2022-10-29 09:21:05 +0200 |
commit | eaa59f085e8854a5cf082179c5f8c97e5efc9b6c (patch) | |
tree | c933e8ea332a9202bbeff15d05bd57d8bb959dcc | |
parent | ca652f86f79855830762e2e7680b6807798437bf (diff) | |
download | gcc-eaa59f085e8854a5cf082179c5f8c97e5efc9b6c.zip gcc-eaa59f085e8854a5cf082179c5f8c97e5efc9b6c.tar.gz gcc-eaa59f085e8854a5cf082179c5f8c97e5efc9b6c.tar.bz2 |
d: Make TARGET_D_MINFO_SECTION hooks in elfos.h the language default.
Removes the last of all TARGET_D_* macro definitions in common target
headers. Now everything is either defined in the D language front-end,
or D-specific target headers.
gcc/ChangeLog:
* config/darwin-d.cc (TARGET_D_MINFO_START_NAME): Rename to ...
(TARGET_D_MINFO_SECTION_START): ...this.
(TARGET_D_MINFO_END_NAME): Rename to ...
(TARGET_D_MINFO_SECTION_END): ... this.
* config/elfos.h (TARGET_D_MINFO_SECTION): Remove.
(TARGET_D_MINFO_START_NAME): Remove.
(TARGET_D_MINFO_END_NAME): Remove.
* config/i386/cygwin-d.cc (TARGET_D_MINFO_SECTION): Remove.
(TARGET_D_MINFO_START_NAME): Remove.
(TARGET_D_MINFO_END_NAME): Remove.
* config/i386/winnt-d.cc (TARGET_D_MINFO_SECTION): Remove.
(TARGET_D_MINFO_START_NAME): Remove.
(TARGET_D_MINFO_END_NAME): Remove.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in (TARGET_D_MINFO_START_NAME): Rename to ...
(TARGET_D_MINFO_SECTION_START): ...this.
(TARGET_D_MINFO_END_NAME): Rename to ...
(TARGET_D_MINFO_SECTION_END): ...this.
gcc/d/ChangeLog:
* d-target.def (d_minfo_section): Expand documentation of hook.
Default initialize to "minfo".
(d_minfo_start_name): Rename to ...
(d_minfo_section_start): ... this. Default initialize to
"__start_minfo".
(d_minfo_end_name): Rename to ...
(d_minfo_section_end): ... this. Default initialize to "__stop_minfo".
* modules.cc (register_moduleinfo): Use new targetdm hook names.
-rw-r--r-- | gcc/config/darwin-d.cc | 8 | ||||
-rw-r--r-- | gcc/config/elfos.h | 6 | ||||
-rw-r--r-- | gcc/config/i386/cygwin-d.cc | 11 | ||||
-rw-r--r-- | gcc/config/i386/winnt-d.cc | 11 | ||||
-rw-r--r-- | gcc/d/d-target.def | 23 | ||||
-rw-r--r-- | gcc/d/modules.cc | 4 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 16 | ||||
-rw-r--r-- | gcc/doc/tm.texi.in | 4 |
8 files changed, 31 insertions, 52 deletions
diff --git a/gcc/config/darwin-d.cc b/gcc/config/darwin-d.cc index 2ceebc4..9730494 100644 --- a/gcc/config/darwin-d.cc +++ b/gcc/config/darwin-d.cc @@ -67,10 +67,10 @@ darwin_d_register_target_info (void) #undef TARGET_D_MINFO_SECTION #define TARGET_D_MINFO_SECTION "__DATA,__minfodata" -#undef TARGET_D_MINFO_START_NAME -#define TARGET_D_MINFO_START_NAME "*section$start$__DATA$__minfodata" +#undef TARGET_D_MINFO_SECTION_START +#define TARGET_D_MINFO_SECTION_START "*section$start$__DATA$__minfodata" -#undef TARGET_D_MINFO_END_NAME -#define TARGET_D_MINFO_END_NAME "*section$end$__DATA$__minfodata" +#undef TARGET_D_MINFO_SECTION_END +#define TARGET_D_MINFO_SECTION_END "*section$end$__DATA$__minfodata" struct gcc_targetdm targetdm = TARGETDM_INITIALIZER; diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h index acb3762..f8b3be4 100644 --- a/gcc/config/elfos.h +++ b/gcc/config/elfos.h @@ -482,9 +482,3 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef TARGET_LIBC_HAS_FUNCTION #define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function - -/* ELF support needed only by D front-end. */ - -#define TARGET_D_MINFO_SECTION "minfo" -#define TARGET_D_MINFO_START_NAME "__start_minfo" -#define TARGET_D_MINFO_END_NAME "__stop_minfo" diff --git a/gcc/config/i386/cygwin-d.cc b/gcc/config/i386/cygwin-d.cc index 619930b..6d70d49 100644 --- a/gcc/config/i386/cygwin-d.cc +++ b/gcc/config/i386/cygwin-d.cc @@ -64,17 +64,6 @@ cygwin_d_register_target_info (void) #undef TARGET_D_REGISTER_OS_TARGET_INFO #define TARGET_D_REGISTER_OS_TARGET_INFO cygwin_d_register_target_info -/* Define TARGET_D_MINFO_SECTION for Cygwin targets. */ - -#undef TARGET_D_MINFO_SECTION -#define TARGET_D_MINFO_SECTION "minfo" - -#undef TARGET_D_MINFO_START_NAME -#define TARGET_D_MINFO_START_NAME "__start_minfo" - -#undef TARGET_D_MINFO_END_NAME -#define TARGET_D_MINFO_END_NAME "__stop_minfo" - /* Define TARGET_D_TEMPLATES_ALWAYS_COMDAT for Cygwin targets. */ #undef TARGET_D_TEMPLATES_ALWAYS_COMDAT diff --git a/gcc/config/i386/winnt-d.cc b/gcc/config/i386/winnt-d.cc index a1fd3fa..843c713 100644 --- a/gcc/config/i386/winnt-d.cc +++ b/gcc/config/i386/winnt-d.cc @@ -69,17 +69,6 @@ winnt_d_register_target_info (void) #undef TARGET_D_REGISTER_OS_TARGET_INFO #define TARGET_D_REGISTER_OS_TARGET_INFO winnt_d_register_target_info -/* Define TARGET_D_MINFO_SECTION for Windows targets. */ - -#undef TARGET_D_MINFO_SECTION -#define TARGET_D_MINFO_SECTION "minfo" - -#undef TARGET_D_MINFO_START_NAME -#define TARGET_D_MINFO_START_NAME "__start_minfo" - -#undef TARGET_D_MINFO_END_NAME -#define TARGET_D_MINFO_END_NAME "__stop_minfo" - /* Define TARGET_D_TEMPLATES_ALWAYS_COMDAT for Windows targets. */ #undef TARGET_D_TEMPLATES_ALWAYS_COMDAT diff --git a/gcc/d/d-target.def b/gcc/d/d-target.def index 7805942..7d999d0 100644 --- a/gcc/d/d-target.def +++ b/gcc/d/d-target.def @@ -70,26 +70,29 @@ the target operating system.", DEFHOOKPOD (d_minfo_section, "Contains the name of the section in which module info references should be\n\ -placed. This section is expected to be bracketed by two symbols to indicate\n\ -the start and end address of the section, so that the runtime library can\n\ -collect all modules for each loaded shared library and executable. The\n\ -default value of @code{NULL} disables the use of sections altogether.", - const char *, NULL) +placed. By default, the compiler puts all module info symbols in the\n\ +@code{\"minfo\"} section. Define this macro to override the string if a\n\ +different section name should be used. This section is expected to be\n\ +bracketed by two symbols @code{TARGET_D_MINFO_SECTION_START} and \n\ +@code{TARGET_D_MINFO_SECTION_END} to indicate the start and end address of\n\ +the section, so that the runtime library can collect all modules for each\n\ +loaded shared library and executable. Setting the value to @code{NULL}\n\ +disables the use of sections for storing module info altogether.", + const char *, "minfo") DEFHOOKPOD -(d_minfo_start_name, +(d_minfo_section_start, "If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined\n\ as the name of the symbol indicating the start address of the module info\n\ section", - const char *, NULL) + const char *, "__start_minfo") -/* The name of the ModuleInfo section. */ DEFHOOKPOD -(d_minfo_end_name, +(d_minfo_section_end, "If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined\n\ as the name of the symbol indicating the end address of the module info\n\ section", - const char *, NULL) + const char *, "__stop_minfo") /* The "stdcall" convention is really supported on 32-bit x86/Windows only. The following hook is a helper to determine whether to apply the attribute diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc index 0aac8fe..4f91853 100644 --- a/gcc/d/modules.cc +++ b/gcc/d/modules.cc @@ -438,11 +438,11 @@ register_moduleinfo (Module *decl, tree minfo) if (!first_module) return; - start_minfo_node = build_dso_registry_var (targetdm.d_minfo_start_name, + start_minfo_node = build_dso_registry_var (targetdm.d_minfo_section_start, ptr_type_node); rest_of_decl_compilation (start_minfo_node, 1, 0); - stop_minfo_node = build_dso_registry_var (targetdm.d_minfo_end_name, + stop_minfo_node = build_dso_registry_var (targetdm.d_minfo_section_end, ptr_type_node); rest_of_decl_compilation (stop_minfo_node, 1, 0); diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 63c8a31..8572313 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10850,19 +10850,23 @@ the target operating system. @deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_SECTION Contains the name of the section in which module info references should be -placed. This section is expected to be bracketed by two symbols to indicate -the start and end address of the section, so that the runtime library can -collect all modules for each loaded shared library and executable. The -default value of @code{NULL} disables the use of sections altogether. +placed. By default, the compiler puts all module info symbols in the +@code{"minfo"} section. Define this macro to override the string if a +different section name should be used. This section is expected to be +bracketed by two symbols @code{TARGET_D_MINFO_SECTION_START} and +@code{TARGET_D_MINFO_SECTION_END} to indicate the start and end address of +the section, so that the runtime library can collect all modules for each +loaded shared library and executable. Setting the value to @code{NULL} +disables the use of sections for storing module info altogether. @end deftypevr -@deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_START_NAME +@deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_SECTION_START If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined as the name of the symbol indicating the start address of the module info section @end deftypevr -@deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_END_NAME +@deftypevr {D Target Hook} {const char *} TARGET_D_MINFO_SECTION_END If @code{TARGET_D_MINFO_SECTION} is defined, then this must also be defined as the name of the symbol indicating the end address of the module info section diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 501ddf1..986e8f0 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -7117,9 +7117,9 @@ floating-point support; they are not included in this mechanism. @hook TARGET_D_MINFO_SECTION -@hook TARGET_D_MINFO_START_NAME +@hook TARGET_D_MINFO_SECTION_START -@hook TARGET_D_MINFO_END_NAME +@hook TARGET_D_MINFO_SECTION_END @hook TARGET_D_HAS_STDCALL_CONVENTION |