aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2003-06-03 18:15:05 +0000
committerH.J. Lu <hjl.tools@gmail.com>2003-06-03 18:15:05 +0000
commit6f6f27f842f3e82a92d651fb02c5b51b7686dc74 (patch)
treeb04e1eb55f80af1e4211b0cd12bda762a1b13a6a /bfd
parenta3b6428fe79103e838aea22ef2acd6578178bf25 (diff)
downloadgdb-6f6f27f842f3e82a92d651fb02c5b51b7686dc74.zip
gdb-6f6f27f842f3e82a92d651fb02c5b51b7686dc74.tar.gz
gdb-6f6f27f842f3e82a92d651fb02c5b51b7686dc74.tar.bz2
bfd/
2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * elflink.h (elf_link_input_bfd): Call linker error_handler for discarded definitions. include/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (LD_DEFINITION_IN_DISCARDED_SECTION): New. ld/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * ldmisc.c: Include "bfdlink.h". (error_handler): Handle LD_DEFINITION_IN_DISCARDED_SECTION and -LD_DEFINITION_IN_DISCARDED_SECTION. * Makefile.am: Rebuild dependency. * Makefile.in: Regenerated. ld/testsuite/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * ld-discard/extern.d: Updated. * ld-discard/start.d: Likewise. * ld-discard/static.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h47
2 files changed, 26 insertions, 26 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index cbd2b41..9ff266a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2003-06-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elflink.h (elf_link_input_bfd): Call linker error_handler
+ for discarded definitions.
+
2003-06-03 Elias Athanasopoulos <elathan@phys.uoa.gr>
* syms.c (decode_section_type): Return 'n' if section flags are
diff --git a/bfd/elflink.h b/bfd/elflink.h
index e7019f3..a7ef742 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -5003,13 +5003,13 @@ elf_link_input_bfd (finfo, input_bfd)
memset (rel, 0, sizeof (*rel));
}
else
- {
- if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, h->root.root.string,
- input_bfd, o, rel->r_offset,
- TRUE)))
- return FALSE;
- }
+ finfo->info->callbacks->error_handler
+ (LD_DEFINITION_IN_DISCARDED_SECTION,
+ _("%T: discarded in section `%s' from %s\n"),
+ h->root.root.string,
+ h->root.root.string,
+ h->root.u.def.section->name,
+ bfd_archive_filename (h->root.u.def.section->owner));
}
}
else
@@ -5028,26 +5028,21 @@ elf_link_input_bfd (finfo, input_bfd)
}
else
{
- bfd_boolean ok;
- const char *msg
- = _("local symbols in discarded section %s");
- bfd_size_type amt
- = strlen (sec->name) + strlen (msg) - 1;
- char *buf = (char *) bfd_malloc (amt);
-
- if (buf != NULL)
- sprintf (buf, msg, sec->name);
- else
- buf = (char *) sec->name;
- ok = (*finfo->info->callbacks
- ->undefined_symbol) (finfo->info, buf,
- input_bfd, o,
- rel->r_offset,
- TRUE);
- if (buf != sec->name)
+ static int count;
+ int ok;
+ char *buf;
+
+ ok = asprintf (&buf, "local symbol %d",
+ count++);
+ if (ok <= 0)
+ buf = (char *) "local symbol";
+ finfo->info->callbacks->error_handler
+ (LD_DEFINITION_IN_DISCARDED_SECTION,
+ _("%T: discarded in section `%s' from %s\n"),
+ buf, buf, sec->name,
+ bfd_archive_filename (input_bfd));
+ if (ok != -1)
free (buf);
- if (!ok)
- return FALSE;
}
}
}