This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: a patch to set ELF header flags for empty linker output files
- To: Jim Wilson <wilson at cygnus dot com>
- Subject: Re: a patch to set ELF header flags for empty linker output files
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Tue, 16 Jan 2001 09:13:13 -0800
- Cc: Nick Clifton <nickc at redhat dot com>, binutils at sources dot redhat dot com
- References: <nickc@redhat.com> <200101160220.SAA19055@wilson.cygnus.com>
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)