This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: [patch 1/3] Extend __libdw_open_file and elf_begin as *_at_offset
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Sun, 02 Mar 2014 22:29:47 +0100
- Subject: Re: [patch 1/3] Extend __libdw_open_file and elf_begin as *_at_offset
On Tue, 25 Feb 2014 23:12:04 +0100, Mark Wielaard wrote:
> I rather not extend the libelf interface if possible. The various libelf
> implementations are already a little diverged. Lets not unnecessarily
> make the divergence even bigger.
I was aware of this issue but I had no other idea.
> If possible, could you mmap the file at
> the offset directly and use elf_memory() instead?
No, I cannot. strace-ing eu-stack shows:
open("/proc/10797/mem", O_RDONLY) = 4
mmap(NULL, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE, 4, 0x400000) = -1 ENODEV (No such device)
pread(4, "\177ELF...", 64, 4194304) = 64
It is not due to a bit inappropriate PROT_WRITE there, with a standalone
testcase ENODEV is there same:
open("/proc/19126/mem", O_RDONLY) = 3
mmap(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x400000) = -1 ENODEV (No such device)
Thanks,
Jan