a patch to set ELF header flags for empty linker output files

H . J . Lu hjl@valinux.com
Tue Jan 16 09:13:00 GMT 2001


On Mon, Jan 15, 2001 at 06:20:37PM -0800, Jim Wilson wrote:
> 
> It seems a little strange to me to ignore an input file.  However, I just
> checked, and I noticed that
> 	 touch tmp.s
> 	 as tmp.s
> does not produce an empty output file.  It produces one with zero-size text,
> data, and bss sections.  If ld -r on an archive is the only way to produce
> an empty output file, then that makes ignoring it more reasonable.

I think "ld -r" is the only way to generate an empty file. However,
I'd like to see to ignore empty input files for all platforms, not
just ia64. Something like

bool bfd_has_contents (bfd *abfd)

should work. We can default it to 1.

> 
> >  "warning - empty and incompatible object file <foo> detected during
> >  link, ignored."
> 
> If the linux kernel hackers are willing to accept a warning.  They might be
> annoyed that something which has always worked before is now suddenly getting
> a warning.  I'd have to check.
> 

If we believe it is ok to ignore an empty input file, why a
meaningless warning? We should either silently ignore it or
generate an error.


-- 
H.J. Lu (hjl@valinux.com)


More information about the Binutils mailing list