PR24499, ignore --add-gnu-debuglink for archives

Message ID 20191119110501.GL13199@bubble.grove.modra.org
State New
Headers show
Series
  • PR24499, ignore --add-gnu-debuglink for archives
Related show

Commit Message

Alan Modra Nov. 19, 2019, 11:05 a.m.
objcopy --add-gnu-debuglink=foo.a.dbg foo.a just doesn't make any
sense.  Who puts executables in archives?  And if you did, wouldn't
you want to calculate the crc over each element of foo.a.dbg?

	PR 24499
	* objcopy.c (copy_file): Ignore --add-gnu-debuglink for archives.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 99cc7beca8..f682fbeef4 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);