This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/13962: Misleading error message when linking a library with an empty library

On Tue, May 15, 2012 at 8:35 PM, Alan Modra <> wrote:
> On Mon, May 14, 2012 at 06:50:29AM -0700, H.J. Lu wrote:
>> Linker should ignore object without symbols. ?OK to install?
> No. ?elf_link_add_object_symbols does more than just read symbols.
> While it would be unusual to have relocs without symbols, or need to
> run check_directives without symbols, I think we should not ignore
> those possibilities.
> Also, having .dynsym sh_info == 1 when sh_size == 0 is somewhat
> broken. ?Ah yes, I knew I'd seen something like this before.
> is the same
> problem but with .symtab. ?For that bug I grumpily decided to make ld
> reject the object file. ?We could do the same here, but I think GNU ld
> itself used to set sh_info wrongly, it's not too hard to fix the bad
> input, and I'm feeling generous. ?So..
> ? ? ? ?PR ld/13962
> ? ? ? ?PR ld/7023
> ? ? ? ?* elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is
> ? ? ? ?out of range. ?As a special case, fix sh_info for zero sh_size.
> ? ? ? ?Do the same for .symtab.

FWIW, gold accepts the DSO without dynamic symbols. ld and
gold should be consistent.  Ian, Cary, what do you think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]