[PATCH 1/2] PR ld/26288: Revert obsolete part of PR ld/26047 fix

Maciej W. Rozycki macro@wdc.com
Thu Jul 23 08:23:13 GMT 2020


Revert commit a3fc941881e4 ("Stop the linker from accepting executable 
ELF files as inputs to other links."), which has been made obsolete by 
commit a87e1817a435 ("Have the linker fail if any attempt to link in an 
executable is made.").  An earlier check triggers added with the latter 
commit making the piece of code removed dead.

	ld/
	PR ld/26288

	Revert:
	PR 26047
	* ldelf.c (ldelf_after_open): Fail if attempting to link one
	executable into another.
---
 ld/ldelf.c |    7 -------
 1 file changed, 7 deletions(-)

binutils-ld-pr26047-old-rev.diff
Index: binutils/ld/ldelf.c
===================================================================
--- binutils.orig/ld/ldelf.c
+++ binutils/ld/ldelf.c
@@ -1078,13 +1078,6 @@ ldelf_after_open (int use_libpath, int n
 	{
 	  int type = 0;
 
-	  if (bfd_link_executable (& link_info)
-	      && elf_tdata (abfd)->elf_header->e_type == ET_EXEC)
-	    {
-	      einfo (_("%F%P: cannot use executable file '%pB' as input to a link\n"),
-		     abfd);
-	    }
-
 	  if (bfd_input_just_syms (abfd))
 	    continue;
 


More information about the Binutils mailing list