I'd like to dump the VDSO to disk in a way that I can verify it is correct with objdump -D
.
We can get the base address of the VDSO with getauxval(AT_SYSINFO_EHDR)
as documented in vdso(7)
. But how does one get the size of the object?
I happen to know it is exactly two pages long, but I'm not certain I can rely on that.
I can't see anything in the ELF header that would indicate the size of the object as a whole, and I've also tried iterating and dumping the sections via dl_iterate_phdr(3)
to no joy (presumably this would skip the ELF header?).
Any ideas? Do I really have to scrape the size out of the proc maps?