diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-06-23 11:09:30 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 1999-06-23 11:09:30 +0000 |
commit | 3dbf70a2184b98af04dfec550fec9ae1a804bdb0 (patch) | |
tree | 22f5010221c6a1018cbff701fc44df60fee86d06 /ld/lexsup.c | |
parent | f0c2e336c82a1b8c7088d07d33e936fabbe1f0ea (diff) | |
download | gdb-3dbf70a2184b98af04dfec550fec9ae1a804bdb0.zip gdb-3dbf70a2184b98af04dfec550fec9ae1a804bdb0.tar.gz gdb-3dbf70a2184b98af04dfec550fec9ae1a804bdb0.tar.bz2 |
* ldmain.c (main): Initialize link_info.init_function and
link_info.fini_function.
* lexsup.c (OPTION_INIT): New macro.
(OPTION_FINI): Likewise.
(ld_options): Add descriptions for them.
(parse_args): Handle them.
Diffstat (limited to 'ld/lexsup.c')
-rw-r--r-- | ld/lexsup.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c index a990693..8f4785b 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -120,6 +120,8 @@ int parsing_defsym = 0; #define OPTION_NO_CHECK_SECTIONS (OPTION_CHECK_SECTIONS + 1) #define OPTION_MPC860C0 (OPTION_NO_CHECK_SECTIONS + 1) #define OPTION_NO_UNDEFINED (OPTION_MPC860C0 + 1) +#define OPTION_INIT (OPTION_NO_UNDEFINED + 1) +#define OPTION_FINI (OPTION_INIT + 1) /* The long options. This structure is used for both the option parsing and the help text. */ @@ -270,6 +272,8 @@ static const struct ld_option ld_options[] = '\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES }, { {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS}, '\0', NULL, N_("Generate embedded relocs"), TWO_DASHES}, + { {"fini", required_argument, NULL, OPTION_FINI}, + '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH }, { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX}, '\0', NULL, N_("Force generation of file with .exe suffix"), TWO_DASHES}, { {"gc-sections", no_argument, NULL, OPTION_GC_SECTIONS}, @@ -280,6 +284,8 @@ static const struct ld_option ld_options[] = TWO_DASHES }, { {"help", no_argument, NULL, OPTION_HELP}, '\0', NULL, N_("Print option help"), TWO_DASHES }, + { {"init", required_argument, NULL, OPTION_INIT}, + '\0', N_("SYMBOL"), N_("Call SYMBOL at load-time"), ONE_DASH }, { {"Map", required_argument, NULL, OPTION_MAP}, '\0', N_("FILE"), N_("Write a map file"), ONE_DASH }, { {"no-demangle", no_argument, NULL, OPTION_NO_DEMANGLE }, @@ -988,6 +994,14 @@ the GNU General Public License. This program has absolutely no warranty.\n")); } command_line.relax = true; break; + + case OPTION_INIT: + link_info.init_function = optarg; + break; + + case OPTION_FINI: + link_info.fini_function = optarg; + break; } } |