2001-11-01 Chris Demetriou <cgd@broadcom.com>
* ld.texinfo (Options): Document new option, -nostdlib. * lexsup.c (OPTION_NOSTDLIB): New definition. (ld_options): Add entry for "nostdlib". (parse_args): Handle OPTIONS_NOSTDLIB. * ldfile.c (ldfile_add_library_path): Don't add directories to the search path if they weren't specified on the command line and -nostdlib was specified. * ld.h (ld_config_type): New member only_cmd_line_lib_dirs.
This commit is contained in:
parent
e3eb7b4206
commit
361b220ebe
11
ld/ChangeLog
11
ld/ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2001-11-01 Chris Demetriou <cgd@broadcom.com>
|
||||||
|
|
||||||
|
* ld.texinfo (Options): Document new option, -nostdlib.
|
||||||
|
* lexsup.c (OPTION_NOSTDLIB): New definition.
|
||||||
|
(ld_options): Add entry for "nostdlib".
|
||||||
|
(parse_args): Handle OPTIONS_NOSTDLIB.
|
||||||
|
* ldfile.c (ldfile_add_library_path): Don't add directories
|
||||||
|
to the search path if they weren't specified on the command line
|
||||||
|
and -nostdlib was specified.
|
||||||
|
* ld.h (ld_config_type): New member only_cmd_line_lib_dirs.
|
||||||
|
|
||||||
2001-10-31 Nick Clifton <nickc@cambridge.redhat.com>
|
2001-10-31 Nick Clifton <nickc@cambridge.redhat.com>
|
||||||
|
|
||||||
* lexsup.c (parse_args): Prevent infinite parsing loop when
|
* lexsup.c (parse_args): Prevent infinite parsing loop when
|
||||||
|
4
ld/ld.h
4
ld/ld.h
@ -214,6 +214,10 @@ typedef struct {
|
|||||||
|
|
||||||
unsigned int split_by_reloc;
|
unsigned int split_by_reloc;
|
||||||
bfd_size_type split_by_file;
|
bfd_size_type split_by_file;
|
||||||
|
|
||||||
|
/* If set, only search library directories explicitly selected
|
||||||
|
on the command line. */
|
||||||
|
boolean only_cmd_line_lib_dirs;
|
||||||
} ld_config_type;
|
} ld_config_type;
|
||||||
|
|
||||||
extern ld_config_type config;
|
extern ld_config_type config;
|
||||||
|
@ -1110,6 +1110,12 @@ Normally, the linker will not produce an output file if it encounters
|
|||||||
errors during the link process; it exits without writing an output file
|
errors during the link process; it exits without writing an output file
|
||||||
when it issues any error whatsoever.
|
when it issues any error whatsoever.
|
||||||
|
|
||||||
|
@kindex -nostdlib
|
||||||
|
@item -nostdlib
|
||||||
|
Only search library directories explicitly specified on the
|
||||||
|
command line. Library directories specified in linker scripts
|
||||||
|
(including linker scripts specified on the command line) are ignored.
|
||||||
|
|
||||||
@ifclear SingleFormat
|
@ifclear SingleFormat
|
||||||
@kindex --oformat
|
@kindex --oformat
|
||||||
@item --oformat @var{output-format}
|
@item --oformat @var{output-format}
|
||||||
|
@ -79,6 +79,9 @@ ldfile_add_library_path (name, cmdline)
|
|||||||
{
|
{
|
||||||
search_dirs_type *new;
|
search_dirs_type *new;
|
||||||
|
|
||||||
|
if (!cmdline && config.only_cmd_line_lib_dirs)
|
||||||
|
return;
|
||||||
|
|
||||||
new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
|
new = (search_dirs_type *) xmalloc (sizeof (search_dirs_type));
|
||||||
new->next = NULL;
|
new->next = NULL;
|
||||||
new->name = name;
|
new->name = name;
|
||||||
|
@ -133,6 +133,7 @@ int parsing_defsym = 0;
|
|||||||
#define OPTION_DISCARD_NONE (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
|
#define OPTION_DISCARD_NONE (OPTION_ALLOW_SHLIB_UNDEFINED + 1)
|
||||||
#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1)
|
#define OPTION_SPARE_DYNAMIC_TAGS (OPTION_DISCARD_NONE + 1)
|
||||||
#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1)
|
#define OPTION_NO_DEFINE_COMMON (OPTION_SPARE_DYNAMIC_TAGS + 1)
|
||||||
|
#define OPTION_NOSTDLIB (OPTION_NO_DEFINE_COMMON + 1)
|
||||||
|
|
||||||
/* The long options. This structure is used for both the option
|
/* The long options. This structure is used for both the option
|
||||||
parsing and the help text. */
|
parsing and the help text. */
|
||||||
@ -330,6 +331,8 @@ static const struct ld_option ld_options[] =
|
|||||||
'\0', NULL, N_("Create an output file even if errors occur"), TWO_DASHES },
|
'\0', NULL, N_("Create an output file even if errors occur"), TWO_DASHES },
|
||||||
{ {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
|
{ {"noinhibit_exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
|
||||||
'\0', NULL, NULL, NO_HELP },
|
'\0', NULL, NULL, NO_HELP },
|
||||||
|
{ {"nostdlib", no_argument, NULL, OPTION_NOSTDLIB},
|
||||||
|
'\0', NULL, N_("Only use library directories specified on\n\t\t\t\tthe command line"), ONE_DASH },
|
||||||
{ {"oformat", required_argument, NULL, OPTION_OFORMAT},
|
{ {"oformat", required_argument, NULL, OPTION_OFORMAT},
|
||||||
'\0', N_("TARGET"), N_("Specify target of output file"), EXACTLY_TWO_DASHES },
|
'\0', N_("TARGET"), N_("Specify target of output file"), EXACTLY_TWO_DASHES },
|
||||||
{ {"qmagic", no_argument, NULL, OPTION_IGNORE},
|
{ {"qmagic", no_argument, NULL, OPTION_IGNORE},
|
||||||
@ -771,6 +774,9 @@ parse_args (argc, argv)
|
|||||||
case OPTION_NOINHIBIT_EXEC:
|
case OPTION_NOINHIBIT_EXEC:
|
||||||
force_make_executable = true;
|
force_make_executable = true;
|
||||||
break;
|
break;
|
||||||
|
case OPTION_NOSTDLIB:
|
||||||
|
config.only_cmd_line_lib_dirs = true;
|
||||||
|
break;
|
||||||
case OPTION_NO_WHOLE_ARCHIVE:
|
case OPTION_NO_WHOLE_ARCHIVE:
|
||||||
whole_archive = false;
|
whole_archive = false;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user