diff mbox series

[v2,11/20] linux/elfnote.h: Replace elf.h with UAPI equivalent

Message ID 20200306133242.26279-12-vincenzo.frascino@arm.com (mailing list archive)
State Superseded
Headers show
Series Introduce common headers | expand

Commit Message

Vincenzo Frascino March 6, 2020, 1:32 p.m. UTC
The vDSO library should only include the necessary headers required for
a userspace library (UAPI and a minimal set of kernel headers). To make
this possible it is necessary to isolate from the kernel headers the
common parts that are strictly necessary to build the library.

Replace linux/elf.h with UAPI equivalent in elfnote.h to make the header
suitable for vDSO inclusion.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 include/linux/elfnote.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kernel test robot March 7, 2020, 1:21 a.m. UTC | #1
Hi Vincenzo,

I love your patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on linus/master v5.6-rc4 next-20200306]
[cannot apply to tip/x86/core tip/timers/vdso]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Vincenzo-Frascino/Introduce-common-headers/20200307-042945
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: parisc-generic-64bit_defconfig (attached as .config)
compiler: hppa64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=parisc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/elf.h:5:0,
                    from include/linux/module.h:18,
                    from crypto/arc4.mod.c:2:
>> arch/parisc/include/asm/elf.h:324:0: warning: "ELF_OSABI" redefined
    #define ELF_OSABI  ELFOSABI_LINUX
    
   In file included from include/linux/elfnote.h:62:0,
                    from include/linux/build-salt.h:4,
                    from crypto/arc4.mod.c:1:
   include/uapi/linux/elf.h:363:0: note: this is the location of the previous definition
    #define ELF_OSABI ELFOSABI_NONE
    

vim +/ELF_OSABI +324 arch/parisc/include/asm/elf.h

^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  312  
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  313  
71d577db01a5177 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  314  #define elf_check_arch(x)		\
71d577db01a5177 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  315  	((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELF_CLASS)
71d577db01a5177 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  316  #define compat_elf_check_arch(x)	\
71d577db01a5177 arch/parisc/include/asm/elf.h Helge Deller   2018-04-11  317  	((x)->e_machine == EM_PARISC && (x)->e_ident[EI_CLASS] == ELFCLASS32)
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  318  
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  319  /*
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  320   * These are used to set parameters in the core dumps.
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  321   */
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  322  #define ELF_DATA	ELFDATA2MSB
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  323  #define ELF_ARCH	EM_PARISC
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16 @324  #define ELF_OSABI 	ELFOSABI_LINUX
^1da177e4c3f415 include/asm-parisc/elf.h      Linus Torvalds 2005-04-16  325  

:::::: The code at line 324 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index f236f5b931b2..594d4e78654f 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -59,7 +59,7 @@ 
 	ELFNOTE_END
 
 #else	/* !__ASSEMBLER__ */
-#include <linux/elf.h>
+#include <uapi/linux/elf.h>
 /*
  * Use an anonymous structure which matches the shape of
  * Elf{32,64}_Nhdr, but includes the name and desc data.  The size and