diff options
Diffstat (limited to 'elfutils/src/ld.c')
-rw-r--r-- | elfutils/src/ld.c | 160 |
1 files changed, 73 insertions, 87 deletions
diff --git a/elfutils/src/ld.c b/elfutils/src/ld.c index a6b664f7..2aece00e 100644 --- a/elfutils/src/ld.c +++ b/elfutils/src/ld.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. Written by Ulrich Drepper <drepper@redhat.com>, 2001. This program is Open Source software; you can redistribute it and/or @@ -38,6 +38,9 @@ static void print_version (FILE *stream, struct argp_state *state); void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; +/* Bug report address. */ +const char *argp_program_bug_address = PACKAGE_BUGREPORT; + /* Values for the various options. */ enum @@ -68,116 +71,121 @@ static const struct argp_option options[] = /* XXX This list will be reordered and section names will be added. Just not right now. */ { "whole-archive", ARGP_whole_archive, NULL, 0, - N_("Include whole archives in the output from now on.") }, + N_("Include whole archives in the output from now on."), 0 }, { "no-whole-archive", ARGP_no_whole_archive, NULL, 0, - N_("Stop including the whole arhives in the output.") }, + N_("Stop including the whole arhives in the output."), 0 }, - { "output", 'o', N_("FILE"), 0, N_("Place output in FILE.") }, + { "output", 'o', N_("FILE"), 0, N_("Place output in FILE."), 0 }, { NULL, 'O', N_("LEVEL"), OPTION_ARG_OPTIONAL, - N_("Set optimization level to LEVEL.") }, + N_("Set optimization level to LEVEL."), 0 }, - { "verbose", 'v', NULL, 0, N_("Verbose messages.") }, - { "trace", 't', NULL, 0, N_("Trace file opens.") }, + { "verbose", 'v', NULL, 0, N_("Verbose messages."), 0 }, + { "trace", 't', NULL, 0, N_("Trace file opens."), 0 }, { "conserve-memory", ARGP_conserve, NULL, 0, - N_("Trade speed for less memory usage") }, + N_("Trade speed for less memory usage"), 0 }, - { NULL, 'z', "KEYWORD", OPTION_HIDDEN, NULL }, + { NULL, 'z', "KEYWORD", OPTION_HIDDEN, NULL, 0 }, { "-z nodefaultlib", '\0', NULL, OPTION_DOC, - N_("Object is marked to not use default search path at runtime.") }, + N_("Object is marked to not use default search path at runtime."), 0 }, { "-z allextract", '\0', NULL, OPTION_DOC, - N_("Same as --whole-archive.") }, + N_("Same as --whole-archive."), 0 }, { "-z defaultextract", '\0', NULL, OPTION_DOC, N_("\ -Default rules of extracting from archive; weak references are not enough.") }, +Default rules of extracting from archive; weak references are not enough."), + 0 }, { "-z weakextract", '\0', NULL, OPTION_DOC, - N_("Weak references cause extraction from archive.") }, + N_("Weak references cause extraction from archive."), 0 }, { "-z muldefs", '\0', NULL, OPTION_DOC, - N_("Allow multiple definitions; first is used.") }, + N_("Allow multiple definitions; first is used."), 0 }, { "-z defs | nodefs", '\0', NULL, OPTION_DOC, - N_("Disallow/allow undefined symbols in DSOs.") }, - { "no-undefined", ARGP_no_undefined, NULL, OPTION_HIDDEN, NULL }, + N_("Disallow/allow undefined symbols in DSOs."), 0 }, + { "no-undefined", ARGP_no_undefined, NULL, OPTION_HIDDEN, NULL, 0 }, { "-z origin", '\0', NULL, OPTION_DOC, - N_("Object requires immediate handling of $ORIGIN.") }, + N_("Object requires immediate handling of $ORIGIN."), 0 }, { "-z now", '\0', NULL, OPTION_DOC, - N_("Relocation will not be processed lazily.") }, + N_("Relocation will not be processed lazily."), 0 }, { "-z nodelete", '\0', NULL, OPTION_DOC, - N_("Object cannot be unloaded at runtime.") }, + N_("Object cannot be unloaded at runtime."), 0 }, { "-z initfirst", '\0', NULL, OPTION_DOC, - N_("Mark object to be initialized first.") }, + N_("Mark object to be initialized first."), 0 }, { "-z lazyload | nolazyload", '\0', NULL, OPTION_DOC, - N_("Enable/disable lazy-loading flag for following dependencies.") }, + N_("Enable/disable lazy-loading flag for following dependencies."), 0 }, { "-z nodlopen", '\0', NULL, OPTION_DOC, - N_("Mark object as not loadable with 'dlopen'.") }, + N_("Mark object as not loadable with 'dlopen'."), 0 }, { "-z ignore | record", '\0', NULL, OPTION_DOC, - N_("Ignore/record dependencies on unused DSOs.") }, + N_("Ignore/record dependencies on unused DSOs."), 0 }, { "-z systemlibrary", '\0', NULL, OPTION_DOC, - N_("Generated DSO will be a system library.") }, + N_("Generated DSO will be a system library."), 0 }, - { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL }, + { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL, 0 }, - { NULL, '(', NULL, 0, N_("Start a group.") }, - { NULL, ')', NULL, 0, N_("End a group.") }, + { NULL, '(', NULL, 0, N_("Start a group."), 0 }, + { NULL, ')', NULL, 0, N_("End a group."), 0 }, { NULL, 'L', N_("PATH"), 0, - N_("Add PATH to list of directories files are searched in.") }, + N_("Add PATH to list of directories files are searched in."), 0 }, - { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE.") }, + { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE."), 0 }, - { "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address.") }, + { "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address."), 0 }, - { "static", ARGP_static, NULL, OPTION_HIDDEN, NULL }, + { "static", ARGP_static, NULL, OPTION_HIDDEN, NULL, 0 }, { "-B static", ARGP_static, NULL, OPTION_DOC, - N_("Do not link against shared libraries.") }, - { "dynamic", ARGP_dynamic, NULL, OPTION_HIDDEN, NULL }, + N_("Do not link against shared libraries."), 0 }, + { "dynamic", ARGP_dynamic, NULL, OPTION_HIDDEN, NULL, 0 }, { "-B dynamic", ARGP_dynamic, NULL, OPTION_DOC, - N_("Prefer linking against shared libraries.") }, + N_("Prefer linking against shared libraries."), 0 }, - { "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols.") }, + { "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols."), 0 }, - { "strip-all", 's', NULL, 0, N_("Strip all symbols.") }, - { "strip-debug", 'S', NULL, 0, N_("Strip debugging symbols.") }, + { "strip-all", 's', NULL, 0, N_("Strip all symbols."), 0 }, + { "strip-debug", 'S', NULL, 0, N_("Strip debugging symbols."), 0 }, { "pagesize", ARGP_pagesize, "SIZE", 0, - N_("Assume pagesize for the target system to be SIZE.") }, + N_("Assume pagesize for the target system to be SIZE."), 0 }, - { "rpath", ARGP_rpath, "PATH", OPTION_HIDDEN, NULL }, - { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL }, + { "rpath", ARGP_rpath, "PATH", OPTION_HIDDEN, NULL, 0 }, + { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL, 0 }, - { "runpath", ARGP_runpath, "PATH", 0, N_("Set runtime DSO search path.") }, + { "runpath", ARGP_runpath, "PATH", 0, N_("Set runtime DSO search path."), + 0 }, { "runpath-link", ARGP_runpath_link, "PATH", 0, - N_("Set link time DSO search path.") }, + N_("Set link time DSO search path."), 0 }, - { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable.") }, + { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable."), + 0 }, { "version-script", ARGP_version_script, "FILE", 0, - N_("Read version information from FILE.") }, + N_("Read version information from FILE."), 0 }, - { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME.") }, + { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME."), 0 }, - { "shared", 'G', NULL, 0, N_("Generate dynamic shared object.") }, - { NULL, 'r', NULL, 0L, N_("Generate relocatable object.") }, + { "shared", 'G', NULL, 0, N_("Generate dynamic shared object."), 0 }, + { NULL, 'r', NULL, 0L, N_("Generate relocatable object."), 0 }, - { NULL, 'B', "KEYWORD", OPTION_HIDDEN, "" }, + { NULL, 'B', "KEYWORD", OPTION_HIDDEN, "", 0 }, { "-B local", 'B', NULL, OPTION_DOC, - N_("Causes symbol not assigned to a version be reduced to local.") }, + N_("Causes symbol not assigned to a version be reduced to local."), 0 }, - { "gc-sections", ARGP_gc_sections, NULL, 0, N_("Remove unused sections.") }, + { "gc-sections", ARGP_gc_sections, NULL, 0, N_("Remove unused sections."), + 0 }, { "no-gc-sections", ARGP_no_gc_sections, NULL, 0, - N_("Don't remove unused sections.") }, + N_("Don't remove unused sections."), 0 }, - { "soname", 'h', "NAME", 0, N_("Set soname of shared object.") }, - { "dynamic-linker", 'I', "NAME", 0, N_("Set the dynamic linker name.") }, + { "soname", 'h', "NAME", 0, N_("Set soname of shared object."), 0 }, + { "dynamic-linker", 'I', "NAME", 0, N_("Set the dynamic linker name."), 0 }, - { NULL, 'Q', "YN", OPTION_HIDDEN, NULL }, + { NULL, 'Q', "YN", OPTION_HIDDEN, NULL, 0 }, { "-Q y | n", 'Q', NULL, OPTION_DOC, - N_("Add/suppress addition indentifying link-editor to .comment section") }, + N_("Add/suppress addition indentifying link-editor to .comment section"), + 0 }, #if YYDEBUG { "yydebug", ARGP_yydebug, NULL, 0, - N_("Select to get parser debug information") }, + N_("Select to get parser debug information"), 0 }, #endif - { NULL, 0, NULL, 0, NULL } + { NULL, 0, NULL, 0, NULL, 0 } }; /* Short description of program. */ @@ -190,17 +198,14 @@ static const char args_doc[] = N_("[FILE]..."); static error_t parse_opt_1st (int key, char *arg, struct argp_state *state); static error_t parse_opt_2nd (int key, char *arg, struct argp_state *state); -/* Function to print some extra text in the help message. */ -static char *more_help (int key, const char *text, void *input); - /* Data structure to communicate with argp functions. */ static struct argp argp_1st = { - options, parse_opt_1st, args_doc, doc, NULL, more_help + options, parse_opt_1st, args_doc, doc, NULL, NULL, NULL }; static struct argp argp_2nd = { - options, parse_opt_2nd, args_doc, doc, NULL, more_help + options, parse_opt_2nd, args_doc, doc, NULL, NULL, NULL }; @@ -478,30 +483,10 @@ main (int argc, char *argv[]) } -static char * -more_help (int key, const char *text, void *input) -{ - char *buf; - - switch (key) - { - case ARGP_KEY_HELP_EXTRA: - /* We print some extra information. */ - if (asprintf (&buf, gettext ("Please report bugs to %s.\n"), - PACKAGE_BUGREPORT) < 0) - buf = NULL; - return buf; - - default: - break; - } - return (char *) text; -} - - /* Quick scan of the parameter list for options with global effect. */ static error_t -parse_opt_1st (int key, char *arg, struct argp_state *state) +parse_opt_1st (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { switch (key) { @@ -685,7 +670,8 @@ parse_opt_1st (int key, char *arg, struct argp_state *state) /* Handle program arguments for real. */ static error_t -parse_opt_2nd (int key, char *arg, struct argp_state *state) +parse_opt_2nd (int key, char *arg, + struct argp_state *state __attribute__ ((unused))) { static bool group_start_requested; static bool group_end_requested; @@ -865,14 +851,14 @@ load_needed (void) /* Print the version information. */ static void -print_version (FILE *stream, struct argp_state *state) +print_version (FILE *stream, struct argp_state *state __attribute__ ((unused))) { fprintf (stream, "ld (%s) %s\n", PACKAGE_NAME, VERSION); fprintf (stream, gettext ("\ Copyright (C) %s Red Hat, Inc.\n\ This is free software; see the source for copying conditions. There is NO\n\ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ -"), "2004"); +"), "2005"); fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper"); } |