Commit d9386123 by Andris Pavenis Committed by Jeff Law

[PATCH] gcc.c: new macro POST_LINK_SPECS to be able to add additional

steps after linking

	* gcc.c (POST_LINK_SPEC): Define if not already defined.
	(LINK_COMMAND_SPEC): Use post_link.
	(post_link_spec): New, initialize to POST_LINK_SPEC.
	(post_link): Initialize new static spec.
	* doc/tm.texi.in (POST_LINK_SPEC): Document.
	* doc/tm.texi: Regenerated.

From-SVN: r230287
parent 93ebf1fd
2015-11-13 Andris Pavenis <andris.pavenis@iki.fi>
* gcc.c (POST_LINK_SPEC): Define if not already defined.
(LINK_COMMAND_SPEC): Use post_link.
(post_link_spec): New, initialize to POST_LINK_SPEC.
(post_link): Initialize new static spec.
* doc/tm.texi.in (POST_LINK_SPEC): Document.
* doc/tm.texi: Regenerated.
2015-11-13 David Malcolm <dmalcolm@redhat.com> 2015-11-13 David Malcolm <dmalcolm@redhat.com>
PR driver/67613 PR driver/67613
...@@ -375,6 +375,11 @@ The sequence in which libgcc and libc are specified to the linker. ...@@ -375,6 +375,11 @@ The sequence in which libgcc and libc are specified to the linker.
By default this is @code{%G %L %G}. By default this is @code{%G %L %G}.
@end defmac @end defmac
@defmac POST_LINK_SPEC
Define this macro to add additional steps to be executed after linker.
The default value of this macro is empty string.
@end defmac
@defmac LINK_COMMAND_SPEC @defmac LINK_COMMAND_SPEC
A C string constant giving the complete command line need to execute the A C string constant giving the complete command line need to execute the
linker. When you do this, you will need to update your port each time a linker. When you do this, you will need to update your port each time a
......
...@@ -375,6 +375,11 @@ The sequence in which libgcc and libc are specified to the linker. ...@@ -375,6 +375,11 @@ The sequence in which libgcc and libc are specified to the linker.
By default this is @code{%G %L %G}. By default this is @code{%G %L %G}.
@end defmac @end defmac
@defmac POST_LINK_SPEC
Define this macro to add additional steps to be executed after linker.
The default value of this macro is empty string.
@end defmac
@defmac LINK_COMMAND_SPEC @defmac LINK_COMMAND_SPEC
A C string constant giving the complete command line need to execute the A C string constant giving the complete command line need to execute the
linker. When you do this, you will need to update your port each time a linker. When you do this, you will need to update your port each time a
......
...@@ -980,6 +980,10 @@ proper position among the other output files. */ ...@@ -980,6 +980,10 @@ proper position among the other output files. */
%{%:sanitize(leak):" LIBLSAN_SPEC "}}}" %{%:sanitize(leak):" LIBLSAN_SPEC "}}}"
#endif #endif
#ifndef POST_LINK_SPEC
#define POST_LINK_SPEC ""
#endif
/* This is the spec to use, once the code for creating the vtable /* This is the spec to use, once the code for creating the vtable
verification runtime library, libvtv.so, has been created. Currently verification runtime library, libvtv.so, has been created. Currently
the vtable verification runtime functions are in libstdc++, so we use the vtable verification runtime functions are in libstdc++, so we use
...@@ -1022,7 +1026,7 @@ proper position among the other output files. */ ...@@ -1022,7 +1026,7 @@ proper position among the other output files. */
%(mflib) " STACK_SPLIT_SPEC "\ %(mflib) " STACK_SPLIT_SPEC "\
%{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \ %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
%{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}" %{!nostdlib:%{!nostartfiles:%E}} %{T*} \n%(post_link) }}}}}}"
#endif #endif
#ifndef LINK_LIBGCC_SPEC #ifndef LINK_LIBGCC_SPEC
...@@ -1064,6 +1068,7 @@ static const char *linker_name_spec = LINKER_NAME; ...@@ -1064,6 +1068,7 @@ static const char *linker_name_spec = LINKER_NAME;
static const char *linker_plugin_file_spec = ""; static const char *linker_plugin_file_spec = "";
static const char *lto_wrapper_spec = ""; static const char *lto_wrapper_spec = "";
static const char *lto_gcc_spec = ""; static const char *lto_gcc_spec = "";
static const char *post_link_spec = POST_LINK_SPEC;
static const char *link_command_spec = LINK_COMMAND_SPEC; static const char *link_command_spec = LINK_COMMAND_SPEC;
static const char *link_libgcc_spec = LINK_LIBGCC_SPEC; static const char *link_libgcc_spec = LINK_LIBGCC_SPEC;
static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC; static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC;
...@@ -1572,6 +1577,7 @@ static struct spec_list static_specs[] = ...@@ -1572,6 +1577,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("linker_plugin_file", &linker_plugin_file_spec), INIT_STATIC_SPEC ("linker_plugin_file", &linker_plugin_file_spec),
INIT_STATIC_SPEC ("lto_wrapper", &lto_wrapper_spec), INIT_STATIC_SPEC ("lto_wrapper", &lto_wrapper_spec),
INIT_STATIC_SPEC ("lto_gcc", &lto_gcc_spec), INIT_STATIC_SPEC ("lto_gcc", &lto_gcc_spec),
INIT_STATIC_SPEC ("post_link", &post_link_spec),
INIT_STATIC_SPEC ("link_libgcc", &link_libgcc_spec), INIT_STATIC_SPEC ("link_libgcc", &link_libgcc_spec),
INIT_STATIC_SPEC ("md_exec_prefix", &md_exec_prefix), INIT_STATIC_SPEC ("md_exec_prefix", &md_exec_prefix),
INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix), INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment