RFC: [PATCH] ELF: Don't require section header on ELF objects

Alan Modra amodra@gmail.com
Mon Mar 9 11:56:22 GMT 2020


On Sun, Mar 08, 2020 at 07:35:56PM -0700, H.J. Lu wrote:
> On Sun, Mar 8, 2020 at 7:23 PM Alan Modra <amodra@gmail.com> wrote:
> > It doesn't.  The snippet of .dynsym I posted was from a binary with
> > DT_GNU_HASH.  elflink.c:_bfd_elf_link_renumber_dynsyms should convince
> > you that any ordering seen is by chance.

I forgot that elf_gnu_hash_process_symidx does in fact perform yet
another ordering of .dynsyms, so undefined non-locals are put before
defined non-locals.

> Entries in DT_GNU_HASH were originally defined.  A backend
> may change some entries to undefined.

Yeah, the function pointer hack to make pointer comparisons work
between an application and shared libray.  SHN_UNDEF but with a
non-zero value like defined symbols, so not really undefined.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list