Skip to content

Commit 24b7c77

Browse files
Sean ChristophersonIngo Molnar
authored andcommitted
x86/vdso: Remove obsolete "fake section table" reservation
At one point the vDSO image was manually stripped down by vdso2c in an attempt to minimize the size of the image mapped into userspace. Part of that stripping process involved building a fake section table so as not to break userspace processes that parse the section table. Memory for the fake section table was reserved in the .rodata section so that vdso2c could simply copy the entire PT_LOAD segment into the userspace image after building the fake table. Eventually, the entire fake section table approach was dropped in favor of stripping the vdso "the old fashioned way", i.e. via objdump -S. But, the reservation in .rodata for the fake table was left behind. Remove the reserveration along with a few other related defines and section entries. Removing the fake section table placeholder zaps a whopping 0x340 bytes from the 64-bit vDSO image, which drops the current image's size to under 4k, i.e. reduces the effective size of the userspace vDSO mapping by a full page. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Acked-by: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Rik van Riel <riel@surriel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: da861e1 ("x86, vdso: Get rid of the fake section mechanism") Link: http://lkml.kernel.org/r/20181204212600.28090-2-sean.j.christopherson@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 566b62a commit 24b7c77

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

arch/x86/entry/vdso/vdso-layout.lds.S

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
* This script controls its layout.
88
*/
99

10-
#if defined(BUILD_VDSO64)
11-
# define SHDR_SIZE 64
12-
#elif defined(BUILD_VDSO32) || defined(BUILD_VDSOX32)
13-
# define SHDR_SIZE 40
14-
#else
15-
# error unknown VDSO target
16-
#endif
17-
18-
#define NUM_FAKE_SHDRS 13
19-
2010
SECTIONS
2111
{
2212
/*
@@ -60,20 +50,8 @@ SECTIONS
6050
*(.bss*)
6151
*(.dynbss*)
6252
*(.gnu.linkonce.b.*)
63-
64-
/*
65-
* Ideally this would live in a C file, but that won't
66-
* work cleanly for x32 until we start building the x32
67-
* C code using an x32 toolchain.
68-
*/
69-
VDSO_FAKE_SECTION_TABLE_START = .;
70-
. = . + NUM_FAKE_SHDRS * SHDR_SIZE;
71-
VDSO_FAKE_SECTION_TABLE_END = .;
7253
} :text
7354

74-
.fake_shstrtab : { *(.fake_shstrtab) } :text
75-
76-
7755
.note : { *(.note.*) } :text :note
7856

7957
.eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr

arch/x86/entry/vdso/vdso2c.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ enum {
7676
sym_hpet_page,
7777
sym_pvclock_page,
7878
sym_hvclock_page,
79-
sym_VDSO_FAKE_SECTION_TABLE_START,
80-
sym_VDSO_FAKE_SECTION_TABLE_END,
8179
};
8280

8381
const int special_pages[] = {
@@ -98,12 +96,6 @@ struct vdso_sym required_syms[] = {
9896
[sym_hpet_page] = {"hpet_page", true},
9997
[sym_pvclock_page] = {"pvclock_page", true},
10098
[sym_hvclock_page] = {"hvclock_page", true},
101-
[sym_VDSO_FAKE_SECTION_TABLE_START] = {
102-
"VDSO_FAKE_SECTION_TABLE_START", false
103-
},
104-
[sym_VDSO_FAKE_SECTION_TABLE_END] = {
105-
"VDSO_FAKE_SECTION_TABLE_END", false
106-
},
10799
{"VDSO32_NOTE_MASK", true},
108100
{"__kernel_vsyscall", true},
109101
{"__kernel_sigreturn", true},

0 commit comments

Comments
 (0)