* ld.h (ld_config_type): Add warn_multiple_gp field.
* lexsup.c (parse_args): Handle --warn-multiple-gp.
* ldmain.c (warning_callback): Suppress multiple gp values warning
if --warn_multiple_gp was not used.
* ld.texinfo, ld.1: Document --warn-multiple-gp.
+Tue Mar 12 12:43:59 1996 David Mosberger-Tang <davidm@koala.azstarnet.com>
+
+ * ld.h (ld_config_type): Add warn_multiple_gp field.
+ * lexsup.c (parse_args): Handle --warn-multiple-gp.
+ * ldmain.c (warning_callback): Suppress multiple gp values warning
+ if --warn_multiple_gp was not used.
+ * ld.texinfo, ld.1: Document --warn-multiple-gp.
+
Tue Mar 12 12:02:21 1996 Ian Lance Taylor <ian@cygnus.com>
* configure: Rebuild with autoconf 2.8.
.RB "[\|" \-\-version "\|]"
.RB "[\|" \-warn\-common "\|]"
.RB "[\|" \-warn\-constructors "\|]"
+.RB "[\|" \-warn\-multiple\-gp "\|]"
.RB "[\|" \-warn\-once "\|]"
.RB "[\|" \-\-whole\-archive "\|]"
.RB "[\|" \-\-no\-whole\-archive "\|]"
not detect the use of global constructors.
.TP
+.B \-warn\-multiple\-gp
+Warn if the output file requires multiple global-pointer values. This
+option is only meaningful for certain processors, such as the Alpha.
+
+.TP
.B \-warn\-once
Only warn once for each undefined symbol, rather than once per module
which refers to it.
[ -Ttext @var{org} ] [ -Tdata @var{org} ]
[ -Tbss @var{org} ] [ -t ] [ -traditional-format ]
[ -u @var{symbol}] [-V] [-v] [ -verbose] [ -version ]
- [ -warn-common ] [ -warn-constructors] [ -warn-once ]
+ [ -warn-common ] [ -warn-constructors] [ -warn-multiple-gp ] [ -warn-once ]
[ -y @var{symbol} ] [ -X ] [-x ]
[ -( [ archives ] -) ]
[ --start-group [ archives ] --end-group ]
object file formats. For formats like COFF or ELF, the linker can not
detect the use of global constructors.
+@kindex -warn-multiple-gp
+@item -warn-multiple-gp
+Warn if multiple global pointer values are required in the output file.
+This is only meaningful for certain processors, such as the Alpha.
+Specifically, some processors put large-valued constants in a special
+section. A special register (the global pointer) points into the middle
+of this section, so that constants can be loaded efficiently via a
+base-register relative addressing mode. Since the offset in
+base-register relative mode is fixed and relatively small (e.g., 16
+bits), this limits the maximum size of the constant pool. Thus, in
+large programs, it is often necessary to use multiple global pointer
+values in order to be able to address all possible constants. This
+option causes a warning to be issued whenever this case occurs.
+
@kindex -warn-once
@cindex warnings, on undefined symbols
@cindex undefined symbols, warnings on
@kindex --whole-archive
@cindex including an entire archive
+@item --whole-archive
For each archive mentioned on the command line after the
@code{--whole-archive} option, include every object file in the archive
in the link, rather than searching the archive for the required object
library.
@kindex --no-whole-archive
+@item --no-whole-archive
Turn off the effect of the @code{--whole-archive} option for archives
which appear later on the command line.
if (! config.build_constructors)
return true;
- ldctor_add_set_entry (h, reloc, section, value);
+ ldctor_add_set_entry (h, reloc, (const char *) NULL, section, value);
if (h->type == bfd_link_hash_new)
{
/* Ensure that BFD_RELOC_CTOR exists now, so that we can give a
useful error message. */
- if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL)
+ if (bfd_reloc_type_lookup (output_bfd, BFD_RELOC_CTOR) == NULL
+ && (link_info.relocateable
+ || bfd_reloc_type_lookup (abfd, BFD_RELOC_CTOR) == NULL))
einfo ("%P%F: BFD backend error: BFD_RELOC_CTOR unsupported\n");
s = set_name;
ourselves. */
}
- ldctor_add_set_entry (h, BFD_RELOC_CTOR, section, value);
+ ldctor_add_set_entry (h, BFD_RELOC_CTOR, name, section, value);
return true;
}
asection *section;
bfd_vma address;
{
+ /* This is a hack to support warn_multiple_gp. FIXME: This should
+ have a cleaner interface, but what? */
+ if (! config.warn_multiple_gp
+ && strcmp (warning, "using multiple gp values") == 0)
+ return true;
+
if (section != NULL)
einfo ("%C: %s\n", abfd, section, address, warning);
else if (abfd == NULL)
/* Parse options for the GNU linker.
- Copyright (C) 1991, 92, 93, 94, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
#define OPTION_VERSION (OPTION_VERBOSE + 1)
#define OPTION_WARN_COMMON (OPTION_VERSION + 1)
#define OPTION_WARN_CONSTRUCTORS (OPTION_WARN_COMMON + 1)
-#define OPTION_WARN_ONCE (OPTION_WARN_CONSTRUCTORS + 1)
+#define OPTION_WARN_MULTIPLE_GP (OPTION_WARN_CONSTRUCTORS + 1)
+#define OPTION_WARN_ONCE (OPTION_WARN_MULTIPLE_GP + 1)
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_ONCE + 1)
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
{"version", no_argument, NULL, OPTION_VERSION},
{"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
{"warn-constructors", no_argument, NULL, OPTION_WARN_CONSTRUCTORS},
+ {"warn-multiple-gp", no_argument, NULL, OPTION_WARN_MULTIPLE_GP},
{"warn-once", no_argument, NULL, OPTION_WARN_ONCE},
{"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
{"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
case OPTION_WARN_CONSTRUCTORS:
config.warn_constructors = true;
break;
+ case OPTION_WARN_MULTIPLE_GP:
+ config.warn_multiple_gp = true;
+ break;
case OPTION_WARN_ONCE:
config.warn_once = true;
break;