summaryrefslogtreecommitdiffstats
path: root/src/ld.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2006-06-11 20:25:23 +0000
committerUlrich Drepper <[email protected]>2006-06-11 20:25:23 +0000
commitcbb51e5253e05d98af8bdaf2217fed00b2e489b9 (patch)
tree200b72eb222a933df79cecc74d4e56383ad803a6 /src/ld.c
parent54f33a779527d6764b4fc4068267715a718c422c (diff)
* elflint.c (check_dynamic): Fix checking value of tags which are
offsets in the string section. Make sure DT_STRTAB points to the section referenced in sh_link. * ld.c (options): Add headers. Add short option 'R' for '--rpath'.
Diffstat (limited to 'src/ld.c')
-rw-r--r--src/ld.c78
1 files changed, 27 insertions, 51 deletions
diff --git a/src/ld.c b/src/ld.c
index a0d00fe2..5c20f475 100644
--- a/src/ld.c
+++ b/src/ld.c
@@ -62,7 +62,6 @@ enum
ARGP_static,
ARGP_dynamic,
ARGP_pagesize,
- ARGP_rpath,
ARGP_rpath_link,
ARGP_runpath,
ARGP_runpath_link,
@@ -83,23 +82,26 @@ enum
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
- /* XXX This list will be reordered and section names will be added.
- Just not right now. */
+ { NULL, 0, NULL, 0, N_("Input File Control:"), 0 },
{ "whole-archive", ARGP_whole_archive, NULL, 0,
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."), 0 },
+ { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL, 0 },
+ { 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."), 0 },
+ { "as-needed", ARGP_as_needed, NULL, 0,
+ N_("Only set DT_NEEDED for following dynamic libs if actually used"), 0 },
+ { "no-as-needed", ARGP_no_as_needed, NULL, 0,
+ N_("Always set DT_NEEDED for following dynamic libs"), 0 },
+ { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL, 0 },
+ { NULL, 'i', NULL, 0, N_("Ignore LD_LIBRARY_PATH environment variable."),
+ 0 },
+ { NULL, 0, NULL, 0, N_("Output File Control:"), 0 },
{ "output", 'o', N_("FILE"), 0, N_("Place output in FILE."), 0 },
-
- { NULL, 'O', N_("LEVEL"), OPTION_ARG_OPTIONAL,
- N_("Set optimization level to LEVEL."), 0 },
-
- { "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"), 0 },
-
{ 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."), 0 },
@@ -131,82 +133,56 @@ Default rules of extracting from archive; weak references are not enough."),
N_("Ignore/record dependencies on unused DSOs."), 0 },
{ "-z systemlibrary", '\0', NULL, OPTION_DOC,
N_("Generated DSO will be a system library."), 0 },
-
- { NULL, 'l', N_("FILE"), OPTION_HIDDEN, NULL, 0 },
-
- { 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."), 0 },
-
- { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE."), 0 },
-
{ "entry", 'e', N_("ADDRESS"), 0, N_("Set entry point address."), 0 },
-
{ "static", ARGP_static, NULL, OPTION_HIDDEN, NULL, 0 },
{ "-B static", ARGP_static, NULL, OPTION_DOC,
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."), 0 },
-
{ "export-dynamic", 'E', NULL, 0, N_("Export all dynamic symbols."), 0 },
-
{ "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."), 0 },
-
- { "rpath", ARGP_rpath, "PATH", OPTION_HIDDEN, NULL, 0 },
- { "rpath-link", ARGP_rpath_link, "PATH", OPTION_HIDDEN, NULL, 0 },
-
+ { "rpath", 'R', "PATH", OPTION_HIDDEN, NULL, 0 },
{ "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."), 0 },
-
- { 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."), 0 },
-
- { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME."), 0 },
-
{ "shared", 'G', NULL, 0, N_("Generate dynamic shared object."), 0 },
{ NULL, 'r', NULL, 0L, N_("Generate relocatable object."), 0 },
-
{ NULL, 'B', "KEYWORD", OPTION_HIDDEN, "", 0 },
{ "-B local", 'B', NULL, OPTION_DOC,
N_("Causes symbol not assigned to a version be reduced to local."), 0 },
-
{ "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."), 0 },
-
{ "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, 0 },
{ "-Q y | n", 'Q', NULL, OPTION_DOC,
N_("Add/suppress addition indentifying link-editor to .comment section"),
0 },
-
- { "as-needed", ARGP_as_needed, NULL, 0,
- N_("Only set DT_NEEDED for following dynamic libs if actually used"), 0 },
- { "no-as-needed", ARGP_no_as_needed, NULL, 0,
- N_("Always set DT_NEEDED for following dynamic libs"), 0 },
-
{ "eh-frame-hdr", ARGP_eh_frame_hdr, NULL, 0,
N_("Create .eh_frame_hdr section"), 0 },
+ { NULL, 0, NULL, 0, N_("Linker Operation Control:"), 0 },
+ { "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"), 0 },
+ { NULL, 'O', N_("LEVEL"), OPTION_ARG_OPTIONAL,
+ N_("Set optimization level to LEVEL."), 0 },
+ { NULL, 'c', N_("FILE"), 0, N_("Use linker script in FILE."), 0 },
#if YYDEBUG
{ "yydebug", ARGP_yydebug, NULL, 0,
N_("Select to get parser debug information"), 0 },
#endif
+ { "version-script", ARGP_version_script, "FILE", 0,
+ N_("Read version information from FILE."), 0 },
+ { "emulation", 'm', "NAME", 0, N_("Set emulation to NAME."), 0 },
{ NULL, 0, NULL, 0, NULL, 0 }
};
@@ -610,7 +586,7 @@ parse_opt_1st (int key, char *arg,
}
break;
- case ARGP_rpath:
+ case 'R':
add_rxxpath (&ld_state.rpath, arg);
break;