From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] Fix vdso32 relocation for paddr
Date: Thu, 27 Aug 2009 00:31:26 +0200 [thread overview]
Message-ID: <20090826223126.GA20373@host0.dyn.jankratochvil.net> (raw)
Hi,
`readelf -Wl file-dumped-from-/proc/self/maps-[vdso]' for x86_64 process prints:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0xffffffffff700000 0xffffffffff700000 0x000890 0x000890 R E 0x1000
DYNAMIC 0x000410 0xffffffffff700410 0xffffffffff700410 0x0000f0 0x0000f0 R 0x8
NOTE 0x0002d0 0xffffffffff7002d0 0xffffffffff7002d0 0x00003c 0x00003c R 0x4
GNU_EH_FRAME 0x00030c 0xffffffffff70030c 0xffffffffff70030c 0x000034 0x000034 R 0x4
while such dump for i386 process prints:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0xffffe000 0x00000000 0x00434 0x00434 R E 0x1000
DYNAMIC 0x000350 0xffffe350 0x00000350 0x00078 0x00078 R 0x4
NOTE 0x0001c4 0xffffe1c4 0x000001c4 0x00060 0x00060 R 0x4
GNU_EH_FRAME 0x000224 0xffffe224 0x00000224 0x00024 0x00024 R 0x4
The mapped location can be arbirary (according to the rules of PIC - Position
Independent Code) but currently the i386 vdso (vdso32) looks as an overlayed
code as it has LMA != VMA (rule contained in GDB function section_is_overlay,
as suggested by Daniel Jacobowitz).
Fixed vdso32 prints:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0xffffe000 0xffffe000 0x00434 0x00434 R E 0x1000
DYNAMIC 0x000350 0xffffe350 0xffffe350 0x00078 0x00078 R 0x4
NOTE 0x0001c4 0xffffe1c4 0xffffe1c4 0x00060 0x00060 R 0x4
GNU_EH_FRAME 0x000224 0xffffe224 0xffffe224 0x00024 0x00024 R 0x4
It required now a workaround in GDB patch so at least to fix it in Linux kernel:
http://sourceware.org/ml/gdb-patches/2009-08/msg00437.html
Thanks,
Jan
Signed-off-by: Jan Kratochvil <jan.kratochvil@redhat.com>
--- linux-2.6.30.x86_64/arch/x86/vdso/vdso32-setup.c-orig 2009-08-26 22:23:08.000000000 +0200
+++ linux-2.6.30.x86_64/arch/x86/vdso/vdso32-setup.c 2009-08-26 22:38:10.000000000 +0200
@@ -172,6 +172,7 @@ static __init void relocate_vdso(Elf32_E
phdr = (void *)ehdr + ehdr->e_phoff;
for (i = 0; i < ehdr->e_phnum; i++) {
phdr[i].p_vaddr += VDSO_ADDR_ADJUST;
+ phdr[i].p_paddr += VDSO_ADDR_ADJUST;
/* relocate dynamic stuff */
if (phdr[i].p_type == PT_DYNAMIC)
next reply other threads:[~2009-08-26 22:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-26 22:31 Jan Kratochvil [this message]
2009-08-28 9:13 ` Américo Wang
[not found] ` <20090828181534.0823745B02@magilla.sf.frob.com>
2009-08-28 21:07 ` Jan Kratochvil
2009-08-28 21:33 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090826223126.GA20373@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®