summaryrefslogtreecommitdiffstats
path: root/arch/x86/vdso/vdso2c.h
diff options
context:
space:
mode:
authorAndy Lutomirski <luto@amacapital.net>2014-06-18 15:59:49 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2014-06-19 15:45:26 -0700
commit0e3727a8839c988a3c56170bc8da76d55a16acad (patch)
treebfecd620ea122be019fdf446d4c716244838fdfd /arch/x86/vdso/vdso2c.h
parentbfad381c0d1e19cae8461e105d8d4387dd2a14fe (diff)
x86/vdso: Remove some redundant in-memory section headers
.data doesn't need to be separate from .rodata: they're both readonly. .altinstructions and .altinstr_replacement aren't needed by anything except vdso2c; strip them from the final image. While we're at it, rather than aligning the actual executable text, just shove some unused-at-runtime data in between real data and text. My vdso image is still above 4k, but I'm disinclined to try to trim it harder for 3.16. For future trimming, I suspect that these sections could be moved to later in the file and dropped from the in-memory image: .gnu.version and .gnu.version_d (this may lose versions in gdb) .eh_frame (should be harmless) .eh_frame_hdr (I'm not really sure) .hash (AFAIK nothing needs this section header) Signed-off-by: Andy Lutomirski <luto@amacapital.net> Link: http://lkml.kernel.org/r/2e96d0c49016ea6d026a614ae645e93edd325961.1403129369.git.luto@amacapital.net Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/vdso/vdso2c.h')
-rw-r--r--arch/x86/vdso/vdso2c.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/x86/vdso/vdso2c.h b/arch/x86/vdso/vdso2c.h
index f01ed4bde88..f42e2ddc663 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,
{
uint64_t flags = GET_LE(&in->sh_flags);
- bool copy = flags & SHF_ALLOC;
+ bool copy = flags & SHF_ALLOC &&
+ strcmp(name, ".altinstructions") &&
+ strcmp(name, ".altinstr_replacement");
if (!copy)
return;