This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] PR24499, ignore --add-gnu-debuglink for archives


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f2032b672ac5f0c570f3a6d263ce6b764e7dca93

commit f2032b672ac5f0c570f3a6d263ce6b764e7dca93
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Nov 19 21:19:24 2019 +1030

    PR24499, ignore --add-gnu-debuglink for archives
    
    objcopy --add-gnu-debuglink=foo.a.dbg foo.a just doesn't make any
    sense.  Who puts executables in archives?
    
    	PR 24499
    	* objcopy.c (copy_file): Ignore --add-gnu-debuglink for archives.

Diff:
---
 binutils/ChangeLog | 5 +++++
 binutils/objcopy.c | 8 ++++++++
 2 files changed, 13 insertions(+)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 19f1c40..eed7d33 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
 2019-11-19  Alan Modra  <amodra@gmail.com>
 
+	PR 24499
+	* objcopy.c (copy_file): Ignore --add-gnu-debuglink for archives.
+
+2019-11-19  Alan Modra  <amodra@gmail.com>
+
 	PR 24968
 	* objcopy.c (copy_object): For ELF output and non-ELF input without
 	arch, take arch from output file if not given by -B.  Don't
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 99cc7be..f682fbe 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -3752,6 +3752,14 @@ copy_file (const char *input_filename, const char *output_filename,
 	  status = 1;
 	  return;
 	}
+
+      if (gnu_debuglink_filename != NULL)
+	{
+	  non_fatal (_("--add-gnu-debuglink ignored for archive %s"),
+		     bfd_get_filename (ibfd));
+	  gnu_debuglink_filename = NULL;
+	}
+
       /* This is a no-op on non-Coff targets.  */
       set_long_section_mode (obfd, ibfd, long_section_names);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]