diff options
| -rw-r--r-- | arch/x86/vdso/vdso-fakesections.c | 3 | ||||
| -rw-r--r-- | arch/x86/vdso/vdso-layout.lds.S | 43 | ||||
| -rw-r--r-- | arch/x86/vdso/vdso2c.h | 4 |
3 files changed, 26 insertions, 24 deletions
diff --git a/arch/x86/vdso/vdso-fakesections.c b/arch/x86/vdso/vdso-fakesections.c index 56927a7e4977..aa5fbfab20a5 100644 --- a/arch/x86/vdso/vdso-fakesections.c +++ b/arch/x86/vdso/vdso-fakesections.c | |||
| @@ -16,9 +16,6 @@ const char fake_shstrtab[] __attribute__((section(".fake_shstrtab"))) = | |||
| 16 | ".rodata\0" | 16 | ".rodata\0" |
| 17 | ".fake_shstrtab\0" /* Yay, self-referential code. */ | 17 | ".fake_shstrtab\0" /* Yay, self-referential code. */ |
| 18 | ".note\0" | 18 | ".note\0" |
| 19 | ".data\0" | ||
| 20 | ".altinstructions\0" | ||
| 21 | ".altinstr_replacement\0" | ||
| 22 | ".eh_frame_hdr\0" | 19 | ".eh_frame_hdr\0" |
| 23 | ".eh_frame\0" | 20 | ".eh_frame\0" |
| 24 | ".text"; | 21 | ".text"; |
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S index e4cbc2145bab..9197544eea9a 100644 --- a/arch/x86/vdso/vdso-layout.lds.S +++ b/arch/x86/vdso/vdso-layout.lds.S | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | # error unknown VDSO target | 14 | # error unknown VDSO target |
| 15 | #endif | 15 | #endif |
| 16 | 16 | ||
| 17 | #define NUM_FAKE_SHDRS 16 | 17 | #define NUM_FAKE_SHDRS 13 |
| 18 | 18 | ||
| 19 | SECTIONS | 19 | SECTIONS |
| 20 | { | 20 | { |
| @@ -28,15 +28,17 @@ SECTIONS | |||
| 28 | .gnu.version_d : { *(.gnu.version_d) } | 28 | .gnu.version_d : { *(.gnu.version_d) } |
| 29 | .gnu.version_r : { *(.gnu.version_r) } | 29 | .gnu.version_r : { *(.gnu.version_r) } |
| 30 | 30 | ||
| 31 | .note : { *(.note.*) } :text :note | ||
| 32 | |||
| 33 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | ||
| 34 | .eh_frame : { KEEP (*(.eh_frame)) } :text | ||
| 35 | |||
| 36 | .dynamic : { *(.dynamic) } :text :dynamic | 31 | .dynamic : { *(.dynamic) } :text :dynamic |
| 37 | 32 | ||
| 38 | .rodata : { | 33 | .rodata : { |
| 39 | *(.rodata*) | 34 | *(.rodata*) |
| 35 | *(.data*) | ||
| 36 | *(.sdata*) | ||
| 37 | *(.got.plt) *(.got) | ||
| 38 | *(.gnu.linkonce.d.*) | ||
| 39 | *(.bss*) | ||
| 40 | *(.dynbss*) | ||
| 41 | *(.gnu.linkonce.b.*) | ||
| 40 | 42 | ||
| 41 | /* | 43 | /* |
| 42 | * Ideally this would live in a C file, but that won't | 44 | * Ideally this would live in a C file, but that won't |
| @@ -50,28 +52,29 @@ SECTIONS | |||
| 50 | 52 | ||
| 51 | .fake_shstrtab : { *(.fake_shstrtab) } :text | 53 | .fake_shstrtab : { *(.fake_shstrtab) } :text |
| 52 | 54 | ||
| 53 | .data : { | ||
| 54 | *(.data*) | ||
| 55 | *(.sdata*) | ||
| 56 | *(.got.plt) *(.got) | ||
| 57 | *(.gnu.linkonce.d.*) | ||
| 58 | *(.bss*) | ||
| 59 | *(.dynbss*) | ||
| 60 | *(.gnu.linkonce.b.*) | ||
| 61 | } | ||
| 62 | 55 | ||
| 63 | .altinstructions : { *(.altinstructions) } | 56 | .note : { *(.note.*) } :text :note |
| 64 | .altinstr_replacement : { *(.altinstr_replacement) } | 57 | |
| 58 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | ||
| 59 | .eh_frame : { KEEP (*(.eh_frame)) } :text | ||
| 60 | |||
| 65 | 61 | ||
| 66 | /* | 62 | /* |
| 67 | * Align the actual code well away from the non-instruction data. | 63 | * Text is well-separated from actual data: there's plenty of |
| 68 | * This is the best thing for the I-cache. | 64 | * stuff that isn't used at runtime in between. |
| 69 | */ | 65 | */ |
| 70 | . = ALIGN(0x100); | ||
| 71 | 66 | ||
| 72 | .text : { *(.text*) } :text =0x90909090, | 67 | .text : { *(.text*) } :text =0x90909090, |
| 73 | 68 | ||
| 74 | /* | 69 | /* |
| 70 | * At the end so that eu-elflint stays happy when vdso2c strips | ||
| 71 | * these. A better implementation would avoid allocating space | ||
| 72 | * for these. | ||
| 73 | */ | ||
| 74 | .altinstructions : { *(.altinstructions) } :text | ||
| 75 | .altinstr_replacement : { *(.altinstr_replacement) } :text | ||
| 76 | |||
| 77 | /* | ||
| 75 | * The remainder of the vDSO consists of special pages that are | 78 | * The remainder of the vDSO consists of special pages that are |
| 76 | * shared between the kernel and userspace. It needs to be at the | 79 | * shared between the kernel and userspace. It needs to be at the |
| 77 | * end so that it doesn't overlap the mapping of the actual | 80 | * end so that it doesn't overlap the mapping of the actual |
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h index f01ed4bde880..f42e2ddc663d 100644 --- a/arch/x86/vdso/vdso2c.h +++ b/arch/x86/vdso/vdso2c.h | |||
| @@ -92,7 +92,9 @@ static void BITSFUNC(copy_section)(struct BITSFUNC(fake_sections) *out, | |||
| 92 | { | 92 | { |
| 93 | uint64_t flags = GET_LE(&in->sh_flags); | 93 | uint64_t flags = GET_LE(&in->sh_flags); |
| 94 | 94 | ||
| 95 | bool copy = flags & SHF_ALLOC; | 95 | bool copy = flags & SHF_ALLOC && |
| 96 | strcmp(name, ".altinstructions") && | ||
| 97 | strcmp(name, ".altinstr_replacement"); | ||
| 96 | 98 | ||
| 97 | if (!copy) | 99 | if (!copy) |
| 98 | return; | 100 | return; |
