OpenCloudOS-Kernel/arch/powerpc/kernel/vdso32
Michael Ellerman 107521e803 powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO
When building the 32-bit VDSO, we are building 32-bit code as part of
a 64-bit kernel build. That requires us to tweak the cflags to trick
the compiler into building 32-bit code for us. The main way we do that
is by passing -m32, but there are other options that affect code
generation and ABI selection.

In particular when building vgettimeofday.c, we end up passing
-mcall-aixdesc because it's in KBUILD_CFLAGS, which causes the
compiler to generate function descriptors, and dot symbols, eg:

  $ nm arch/powerpc/kernel/vdso32/vgettimeofday.o
  000005d0 T .__c_kernel_clock_getres
  00000024 D __c_kernel_clock_getres
  ...

We get away with that at the moment because we also use the DOTSYM
macro, and that is also incorrectly prepending a '.' in 32-bit VDSO
code due to a separate bug.

But we shouldn't be generating function descriptors for this file,
there's no 32-bit ABI that includes function descriptors, so the
resulting object file is some frankenstein and it's surprising that it
even links.

So filter out all the ABI-related options we add to CFLAGS for 64-bit
builds, so that they're not used when building 32-bit code. With that
we only see regular text symbols:

  $ nm arch/powerpc/kernel/vdso32/vgettimeofday.o                                                                                                                                     michael@alpine1-p1
  000005d0 T __c_kernel_clock_getres
  00000000 T __c_kernel_clock_gettime
  00000200 T __c_kernel_clock_gettime64
  00000410 T __c_kernel_gettimeofday
  00000650 T __c_kernel_time

Fixes: ab037dd87a ("powerpc/vdso: Switch VDSO to generic C implementation.")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201218111619.1206391-2-mpe@ellerman.id.au
2020-12-21 22:06:26 +11:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO 2020-12-21 22:06:26 +11:00
cacheflush.S powerpc/vdso: Merge __kernel_sync_dicache_p5() into __kernel_sync_dicache() 2020-12-04 01:01:17 +11:00
datapage.S powerpc/vdso: Remove __kernel_datapage_offset 2020-12-04 01:01:18 +11:00
gen_vdso_offsets.sh powerpc/vdso: Retrieve sigtramp offsets at buildtime 2020-12-04 01:01:17 +11:00
getcpu.S powerpc/vdso32: miscellaneous optimisations 2020-01-23 21:31:16 +11:00
gettimeofday.S powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32 2020-12-04 01:01:11 +11:00
note.S powerpc: Add build salt to the vDSO 2018-07-18 01:18:05 +09:00
sigtramp.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
vdso32.lds.S powerpc: Use common STABS_DEBUG and DWARF_DEBUG and ELF_DETAILS macro 2020-12-04 01:01:20 +11:00
vdso32_wrapper.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vgettimeofday.c powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32 2020-12-04 01:01:11 +11:00