Re: vdso handling

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.gnu.binutils,gmane.comp.gdb.devel
Message-ID <1676801.XSU6BsarlE@vapier>
On Wed 12 Mar 2014 17:47:02 Alan Modra wrote:
> On Mon, Mar 10, 2014 at 01:04:33PM +0000, Metzger, Markus T wrote:
> > I noticed that the BFD created for the VDSO (system-provided in-memory
> > DSO) does not contain any BFD sections.  Is this intentional?  Or has
> > there just been no need for them?
> 
> [snip]
> 
> > The vdso is processed in symbol_file_add_from_memory at
> > gdb/symfile-mem.c:84.  It calls bfd_from_remote_memory to create a BFD
> > for the vdso and then processes it.
> 
> The underlying cause is that you're trying to debug an ELF binary that
> only contains the execution view.  The linking view (of which the
> sections are a part) is not loaded, so bfd_from_remote_memory does not
> have this information.  See elfcode.h bfd_from_remote_memory.
> 
> You can see similar breakage of gdb and binutils if you zap e_shoff,
> e_shnum, and e_shstrndx of your favourite hello world program.
> 
> I suppose one way to provide something that gdb and other tools expect
> would be to treat the vdso like a core file, and create fake sections
> corresponding to the program headers.  I'm not really keen on the idea
> though, since I know that will open up a can of worms.
> 
> Can't you point gdb at a file image for the vdso?

i don't think distros generally ship it ?  the kernel doesn't install it by 
default (e.g. into /lib/modules/$(uname -r)/vdso/).
-mike
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAABAgAGBQJTIEV3AAoJEEFjO5/oN/WBHokP/i529focy60MXKHIeNIJJMMF
SYzyQDLxfzQJt8JYcz/ZdHvkQY8lvKUOA52PcQpD3OnTET4iulN4YBwGcMtjYI89
9Ey0MYhnNXg8zf0SZqvDK9NzTu7ErJkDyPCSp+Y2S7y8iKvDBmw/UBZ9OKaSX52X
wKqI1pML02DvscFcG32n8gf0PEbnz5y6mEKTA0JKwVEO+FJTcvYpsB1ikievOIqQ
YeJXOP7FcPLIyce94JgEWKp+7WnZpvCRDkcW8jXxqzT4h9VIfU7s1HbhWg8kQzn8
dyzLMGFcqEcFMGqzNTxkNYqdS2iqnJF5/d3b6GXMmeOV9EnnAjVHN5vudtQjgTkZ
hb80VuTsn+piDK602MyrvolZiylWTt7f4sjbElyMnGXlpibJIMmx4ryKLNDNtlgQ
B+bPRa99P0IHZfyd3AXUJq5RuZjeztnkMwh2L8PGYA5QGxtuAa2aG9hGvJjs2BIy
rfOEN/8yA7KQHMWccr1VBGF46rXJvFJZIFBtnS1Ysl8UtCUA2Y1VFOSPeJu5OnTS
W8jyxQnKmSBPH8H7iz1s1wRKPezEamFjceheCPxGPUXY91UpUk9NBJdbrLTNv8wo
zlayTdgxIuMdib6bUs94IQ6yCKA7peE4THgwYOOZvG86hmYTdJzfVPQoRYBEEISS
UOdWVWTyWeHmx+JWg2Jm
=OT3f
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.