diff options
author | Will Deacon <will.deacon@arm.com> | 2014-02-04 14:41:26 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-20 11:06:11 -0800 |
commit | 6737eaebff6297e5b6aeb458a4b4ad4b61df8f57 (patch) | |
tree | 4de8c1e5e99b248def4e935980230079c45551b6 | |
parent | b666f382900c74f23c78556777041c2ceb7c2b24 (diff) | |
download | linux-3.10-6737eaebff6297e5b6aeb458a4b4ad4b61df8f57.tar.gz linux-3.10-6737eaebff6297e5b6aeb458a4b4ad4b61df8f57.tar.bz2 linux-3.10-6737eaebff6297e5b6aeb458a4b4ad4b61df8f57.zip |
arm64: vdso: prevent ld from aligning PT_LOAD segments to 64k
commit 40507403485fcb56b83d6ddfc954e9b08305054c upstream.
Whilst the text segment for our VDSO is marked as PT_LOAD in the ELF
headers, it is mapped by the kernel and not actually subject to
demand-paging. ld doesn't realise this, and emits a p_align field of 64k
(the maximum supported page size), which conflicts with the load address
picked by the kernel on 4k systems, which will be 4k aligned. This
causes GDB to fail with "Failed to read a valid object file image from
memory" when attempting to load the VDSO.
This patch passes the -n option to ld, which prevents it from aligning
PT_LOAD segments to the maximum page size.
Reported-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Kyle McMartin <kyle@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/arm64/kernel/vdso/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index d8064af42e6..6d20b7d162d 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -48,7 +48,7 @@ $(obj-vdso): %.o: %.S # Actual build commands quiet_cmd_vdsold = VDSOL $@ - cmd_vdsold = $(CC) $(c_flags) -Wl,-T $^ -o $@ + cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ quiet_cmd_vdsoas = VDSOA $@ cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $< |