From: "Kirill A. Shutemov" Do not export asm/elf.h during make headers_install. Signed-off-by: Kirill A. Shutemov Reviewed-by: David Woodhouse Signed-off-by: Andrew Morton --- include/asm-generic/Kbuild.asm | 1 - include/linux/Kbuild | 2 +- include/linux/elf.h | 2 ++ include/linux/elfcore.h | 2 ++ 4 files changed, 5 insertions(+), 2 deletions(-) diff -puN include/asm-generic/Kbuild.asm~unexport-asm-elfh include/asm-generic/Kbuild.asm --- a/include/asm-generic/Kbuild.asm~unexport-asm-elfh +++ a/include/asm-generic/Kbuild.asm @@ -29,5 +29,4 @@ unifdef-y += types.h unifdef-y += unistd.h # These probably shouldn't be exported -unifdef-y += elf.h unifdef-y += page.h diff -puN include/linux/Kbuild~unexport-asm-elfh include/linux/Kbuild --- a/include/linux/Kbuild~unexport-asm-elfh +++ a/include/linux/Kbuild @@ -59,7 +59,6 @@ header-y += dqblk_v2.h header-y += dqblk_xfs.h header-y += efs_fs_sb.h header-y += elf-fdpic.h -header-y += elf.h header-y += elf-em.h header-y += fadvise.h header-y += fd.h @@ -190,6 +189,7 @@ unifdef-y += dccp.h unifdef-y += dirent.h unifdef-y += dlm.h unifdef-y += edd.h +unifdef-y += elf.h unifdef-y += elfcore.h unifdef-y += errno.h unifdef-y += errqueue.h diff -puN include/linux/elf.h~unexport-asm-elfh include/linux/elf.h --- a/include/linux/elf.h~unexport-asm-elfh +++ a/include/linux/elf.h @@ -3,7 +3,9 @@ #include #include +#ifdef __KERNEL__ #include +#endif struct file; diff -puN include/linux/elfcore.h~unexport-asm-elfh include/linux/elfcore.h --- a/include/linux/elfcore.h~unexport-asm-elfh +++ a/include/linux/elfcore.h @@ -16,7 +16,9 @@ struct elf_siginfo int si_errno; /* errno */ }; +#ifdef __KERNEL__ #include +#endif #ifndef __KERNEL__ typedef elf_greg_t greg_t; _