[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/29284] ld silently exits with empty input files with success

From: nickc at redhat dot com
Subject: [Bug ld/29284] ld silently exits with empty input files with success
Date: Tue, 28 Jun 2022 15:59:14 +0000


--- Comment #3 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Jan Engelhardt from comment #2)
Hi Jan,

> Is the output really empty - or at least empty in the BFD sense? a.out is
> 394 bytes in my case.

In a BFD sense yes - the file has nothing of interest in it.  In a file 
system sense no - there are bytes there as you have discovered.  The linker 
does in fact create an ELF format file, albeit one that is basically useless.

But anyway I have asked around a bit and it seems that there are cases 
where "empty" output files (in the BFD sense) are in fact expected/needed.
So the patch is a non-starter.

Instead I could create a patch to add a new linker command line option which
would warn about zero-length scripts (in the filesystem sense).  I think that
it would have to be disabled by default though, given the point you raised in
the description.  But that would not really be of much help to you since you 
would have to modify your build machinery to include it, and if you are doing
that then you could just add a test of the output file to see if it matches
your expectations.

I am not sure what else to suggest, sorry.


You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]