aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-06-22 09:02:05 +0000
committerNick Clifton <nickc@redhat.com>2001-06-22 09:02:05 +0000
commitaf3bdff75326c3169c079883f7f901045c0c98a4 (patch)
tree3742f2f4857911f07d89da09a02619a65ce69cd3 /binutils
parentfe1f01309fd3661baf46df9fa49aac0750399e11 (diff)
downloadgdb-af3bdff75326c3169c079883f7f901045c0c98a4.zip
gdb-af3bdff75326c3169c079883f7f901045c0c98a4.tar.gz
gdb-af3bdff75326c3169c079883f7f901045c0c98a4.tar.bz2
Add missing support for -o option.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog5
-rw-r--r--binutils/objcopy.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 8fb9f19..3cd6e46 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-22 Jocelyn Mayer <jocelyn.mayer@netgem.com>
+
+ * objcopy.c (strip_main): Support -o or --output-file command lien
+ switch.
+
2001-06-19 H.J. Lu <hjl@gnu.org>
* doc/Makefile.in: Regenerated.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 4afec5b..1d3efc7 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -240,6 +240,7 @@ static struct option strip_options[] =
{"keep-symbol", required_argument, 0, 'K'},
{"output-format", required_argument, 0, 'O'}, /* Obsolete */
{"output-target", required_argument, 0, 'O'},
+ {"output-file", required_argument, 0, 'o'},
{"preserve-dates", no_argument, 0, 'p'},
{"remove-section", required_argument, 0, 'R'},
{"strip-all", no_argument, 0, 's'},
@@ -777,7 +778,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
even if relocatable is false. External users of the
library containing the $idata section may reference these
symbols. */
- keep = 1;
+ keep = 1;
else if ((flags & BSF_GLOBAL) != 0 /* Global symbol. */
|| (flags & BSF_WEAK) != 0
|| bfd_is_und_section (bfd_get_section (sym))
@@ -787,6 +788,10 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
keep = (strip_symbols != STRIP_DEBUG
&& strip_symbols != STRIP_UNNEEDED
&& ! convert_debugging);
+ else if (bfd_get_section (sym)->comdat)
+ /* COMDAT sections store special information in local
+ symbols, so we cannot risk stripping any of them. */
+ keep = 1;
else /* Local symbol. */
keep = (strip_symbols != STRIP_UNNEEDED
&& (discard_locals != LOCALS_ALL
@@ -799,7 +804,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount)
keep = 1;
if (keep && is_strip_section (abfd, bfd_get_section (sym)))
keep = 0;
-
+
if (keep && (flags & BSF_GLOBAL) != 0
&& (weaken || is_specified_symbol (name, weaken_specific_list)))
{
@@ -1840,7 +1845,7 @@ strip_main (argc, argv)
struct section_list *p;
char *output_file = NULL;
- while ((c = getopt_long (argc, argv, "b:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:",
+ while ((c = getopt_long (argc, argv, "b:i:o:I:j:K:N:s:O:d:F:L:G:R:SpgxXVvW:",
strip_options, (int *) 0)) != EOF)
{
switch (c)