Re: vdso handling

Alan Modra
2014-03-13T23:53:57Z

On Thu, Mar 13, 2014 at 03:26:18PM +0000, Pedro Alves wrote:
> So it seems like the whole vdso should be always mapped in.

OK, so I think Markus should be looking at why bfd_from_remote_memory
decides to exclude the section headers. ie. why the following code
is being executed

/* If the segments visible in memory didn't include the section headers,
then clear them from the file header. */
if ((bfd_vma) contents_size < (i_ehdr.e_shoff
+ i_ehdr.e_shnum * i_ehdr.e_shentsize))
{
memset (&x_ehdr.e_shoff, 0, sizeof x_ehdr.e_shoff);
memset (&x_ehdr.e_shnum, 0, sizeof x_ehdr.e_shnum);
memset (&x_ehdr.e_shstrndx, 0, sizeof x_ehdr.e_shstrndx);
}

It may be that we can tweak the heuristic. One thing I noticed is
that the following

/* Trim the last segment so we don't bother with zeros in the last page
that are off the end of the file. However, if the extra bit in that
page includes the section headers, keep them. */

will trim off .symtab which might otherwise be available. GNU ld places
.symtab after the section headers.

--
Alan Modra
Australia Development Lab, IBM