]> Git Repo - linux.git/commitdiff
x86/vdso: Remove obsolete "fake section table" reservation
authorSean Christopherson <[email protected]>
Tue, 4 Dec 2018 21:25:57 +0000 (13:25 -0800)
committerIngo Molnar <[email protected]>
Wed, 5 Dec 2018 07:58:11 +0000 (08:58 +0100)
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 <[email protected]>
Acked-by: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: da861e18eccc ("x86, vdso: Get rid of the fake section mechanism")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/entry/vdso/vdso-layout.lds.S
arch/x86/entry/vdso/vdso2c.c

index acfd5ba7d943fed7016f344b6a30becae7e8549e..0cedc905c8d6704b967daba8ad0f438fa9fe8c35 100644 (file)
@@ -7,16 +7,6 @@
  * This script controls its layout.
  */
 
-#if defined(BUILD_VDSO64)
-# define SHDR_SIZE 64
-#elif defined(BUILD_VDSO32) || defined(BUILD_VDSOX32)
-# define SHDR_SIZE 40
-#else
-# error unknown VDSO target
-#endif
-
-#define NUM_FAKE_SHDRS 13
-
 SECTIONS
 {
        /*
@@ -60,20 +50,8 @@ SECTIONS
                *(.bss*)
                *(.dynbss*)
                *(.gnu.linkonce.b.*)
-
-               /*
-                * Ideally this would live in a C file, but that won't
-                * work cleanly for x32 until we start building the x32
-                * C code using an x32 toolchain.
-                */
-               VDSO_FAKE_SECTION_TABLE_START = .;
-               . = . + NUM_FAKE_SHDRS * SHDR_SIZE;
-               VDSO_FAKE_SECTION_TABLE_END = .;
        }                                               :text
 
-       .fake_shstrtab  : { *(.fake_shstrtab) }         :text
-
-
        .note           : { *(.note.*) }                :text   :note
 
        .eh_frame_hdr   : { *(.eh_frame_hdr) }          :text   :eh_frame_hdr
index 4674f58581a16cd6e1203141c590907d44cbc6a6..8e470b018512c29f41d0adc7dd8717b155a07229 100644 (file)
@@ -76,8 +76,6 @@ enum {
        sym_hpet_page,
        sym_pvclock_page,
        sym_hvclock_page,
-       sym_VDSO_FAKE_SECTION_TABLE_START,
-       sym_VDSO_FAKE_SECTION_TABLE_END,
 };
 
 const int special_pages[] = {
@@ -98,12 +96,6 @@ struct vdso_sym required_syms[] = {
        [sym_hpet_page] = {"hpet_page", true},
        [sym_pvclock_page] = {"pvclock_page", true},
        [sym_hvclock_page] = {"hvclock_page", true},
-       [sym_VDSO_FAKE_SECTION_TABLE_START] = {
-               "VDSO_FAKE_SECTION_TABLE_START", false
-       },
-       [sym_VDSO_FAKE_SECTION_TABLE_END] = {
-               "VDSO_FAKE_SECTION_TABLE_END", false
-       },
        {"VDSO32_NOTE_MASK", true},
        {"__kernel_vsyscall", true},
        {"__kernel_sigreturn", true},
This page took 0.059387 seconds and 4 git commands to generate.