aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmain.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-03-12 17:47:55 +0000
committerIan Lance Taylor <ian@airs.com>1996-03-12 17:47:55 +0000
commit4b7d2399aed55fadb8aa6fbc04d8ca966d33ab91 (patch)
tree0245fa2a2b067bf8f1aade61eb1bc59f56fe0936 /ld/ldmain.c
parenta10d3dec45424072f969d3a09916f42a65a7eed6 (diff)
downloadgdb-4b7d2399aed55fadb8aa6fbc04d8ca966d33ab91.zip
gdb-4b7d2399aed55fadb8aa6fbc04d8ca966d33ab91.tar.gz
gdb-4b7d2399aed55fadb8aa6fbc04d8ca966d33ab91.tar.bz2
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.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r--ld/ldmain.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 15fac43..5dbfc55 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -735,7 +735,7 @@ add_to_set (info, h, reloc, abfd, section, value)
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)
{
@@ -775,7 +775,9 @@ constructor_callback (info, constructor, name, abfd, section, value)
/* 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;
@@ -802,7 +804,7 @@ constructor_callback (info, constructor, name, abfd, section, value)
ourselves. */
}
- ldctor_add_set_entry (h, BFD_RELOC_CTOR, section, value);
+ ldctor_add_set_entry (h, BFD_RELOC_CTOR, name, section, value);
return true;
}
@@ -829,6 +831,12 @@ warning_callback (info, warning, symbol, abfd, section, address)
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)