From: Nick Desaulniers <ndesaulniers@google.com> Date: 2020-09-01 22:25:40
Kees Cook is working on series that adds --orphan-section=warn to arm,
arm64, and x86. I noticed that ppc vdso were still using cc-ldoption
for these which I removed. It seems this results in that flag being
silently dropped.
I'm very confident with the first patch, but the second needs closer
review around the error mentioned below the fold related to the .got
section.
Nick Desaulniers (2):
powerpc/vdso64: link vdso64 with linker
powerpc/vdso32: link vdso64 with linker
arch/powerpc/include/asm/vdso.h | 17 ++---------------
arch/powerpc/kernel/vdso32/Makefile | 7 +++++--
arch/powerpc/kernel/vdso32/vdso32.lds.S | 3 ++-
arch/powerpc/kernel/vdso64/Makefile | 8 ++++++--
arch/powerpc/kernel/vdso64/vdso64.lds.S | 1 -
5 files changed, 15 insertions(+), 21 deletions(-)
--
2.28.0.402.g5ffc5be6b7-goog
From: Nick Desaulniers <ndesaulniers@google.com> Date: 2020-09-01 22:25:42
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Painstakingly compared the output between `objdump -a` before and after
this change. Now function symbols have the correct type of FUNC rather
than NONE, and the entry is slightly different (which doesn't matter for
the vdso). Binary size is the same.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
arch/powerpc/include/asm/vdso.h | 17 ++---------------
arch/powerpc/kernel/vdso64/Makefile | 8 ++++++--
arch/powerpc/kernel/vdso64/vdso64.lds.S | 1 -
3 files changed, 8 insertions(+), 18 deletions(-)
From: Nick Desaulniers <ndesaulniers@google.com> Date: 2020-09-01 22:25:45
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Requires dropping the .got section. I couldn't find how it was used in
the vdso32.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
Not sure removing .got is a good idea or not. Otherwise I observe the
following link error:
powerpc-linux-gnu-ld: warning: orphan section `.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.got'
powerpc-linux-gnu-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc-linux-gnu-ld: final link failed: bad value
sigtramp.c doesn't mention anything from the GOT AFAICT, and doesn't
look like it contains relocations that do, so I'm not sure where
references to _GLOBAL_OFFSET_TABLE_ are coming from.
arch/powerpc/kernel/vdso32/Makefile | 7 +++++--
arch/powerpc/kernel/vdso32/vdso32.lds.S | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
I think $subject needs a typo update... vdso32...
On Tue, Sep 01, 2020 at 03:25:23PM -0700, Nick Desaulniers wrote:
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Requires dropping the .got section. I couldn't find how it was used in
the vdso32.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
Not sure removing .got is a good idea or not. Otherwise I observe the
following link error:
powerpc-linux-gnu-ld: warning: orphan section `.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.got'
powerpc-linux-gnu-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc-linux-gnu-ld: final link failed: bad value
If it's like the x86 and arm toolchains, I think you'll be required to
keep .got, but you can assert it to a 0 size, e.g.:
/*
* Sections that should stay zero sized, which is safer to
* explicitly check instead of blindly discarding.
*/
.got : {
*(.got)
}
ASSERT(SIZEOF(.got) == 0, "Unexpected GOT entries detected!")
(and put that at the end of the linker script)
-Kees
quoted hunk
sigtramp.c doesn't mention anything from the GOT AFAICT, and doesn't
look like it contains relocations that do, so I'm not sure where
references to _GLOBAL_OFFSET_TABLE_ are coming from.
arch/powerpc/kernel/vdso32/Makefile | 7 +++++--
arch/powerpc/kernel/vdso32/vdso32.lds.S | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
On Tue, Sep 01, 2020 at 03:25:21PM -0700, Nick Desaulniers wrote:
Kees Cook is working on series that adds --orphan-section=warn to arm,
arm64, and x86. I noticed that ppc vdso were still using cc-ldoption
for these which I removed. It seems this results in that flag being
silently dropped.
I'm very confident with the first patch, but the second needs closer
review around the error mentioned below the fold related to the .got
section.
Nick Desaulniers (2):
powerpc/vdso64: link vdso64 with linker
powerpc/vdso32: link vdso64 with linker
arch/powerpc/include/asm/vdso.h | 17 ++---------------
arch/powerpc/kernel/vdso32/Makefile | 7 +++++--
arch/powerpc/kernel/vdso32/vdso32.lds.S | 3 ++-
arch/powerpc/kernel/vdso64/Makefile | 8 ++++++--
arch/powerpc/kernel/vdso64/vdso64.lds.S | 1 -
5 files changed, 15 insertions(+), 21 deletions(-)
--
2.28.0.402.g5ffc5be6b7-goog
ppc44x_defconfig and powernv_defconfig start failing with this series
when LD=ld.lld is used.
$ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- LLVM=1 O=out/ppc32 distclean ppc44x_defconfig uImage
ld.lld: error: relocation R_PPC_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso32/datapage.o
referenced by arch/powerpc/kernel/vdso32/gettimeofday.o:(__kernel_gettimeofday)
ld.lld: error: relocation R_PPC_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso32/datapage.o
referenced by arch/powerpc/kernel/vdso32/gettimeofday.o:(__kernel_clock_gettime)
ld.lld: error: relocation R_PPC_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso32/datapage.o
referenced by arch/powerpc/kernel/vdso32/gettimeofday.o:(__kernel_clock_getres)
ld.lld: error: relocation R_PPC_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso32/datapage.o
referenced by arch/powerpc/kernel/vdso32/gettimeofday.o:(__kernel_time)
...
$ make -skj"$(nproc)" ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- LLVM=1 O=out/ppc64le distclean powernv_defconfig zImage.epapr
ld.lld: error: relocation R_PPC64_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso64/datapage.o
referenced by arch/powerpc/kernel/vdso64/gettimeofday.o:(__kernel_gettimeofday)
ld.lld: error: relocation R_PPC64_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso64/datapage.o
referenced by arch/powerpc/kernel/vdso64/gettimeofday.o:(__kernel_clock_gettime)
ld.lld: error: relocation R_PPC64_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso64/datapage.o
referenced by arch/powerpc/kernel/vdso64/gettimeofday.o:(__kernel_clock_getres)
ld.lld: error: relocation R_PPC64_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso64/datapage.o
referenced by arch/powerpc/kernel/vdso64/gettimeofday.o:(__kernel_time)
ld.lld: error: relocation R_PPC64_REL16_LO cannot be used against symbol __kernel_datapage_offset; recompile with -fPIC
quoted
quoted
defined in arch/powerpc/kernel/vdso64/datapage.o
referenced by arch/powerpc/kernel/vdso64/cacheflush.o:(__kernel_sync_dicache)
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Requires dropping the .got section. I couldn't find how it was used in
the vdso32.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
Not sure removing .got is a good idea or not. Otherwise I observe the
following link error:
powerpc-linux-gnu-ld: warning: orphan section `.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.got'
powerpc-linux-gnu-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc-linux-gnu-ld: final link failed: bad value
sigtramp.c doesn't mention anything from the GOT AFAICT, and doesn't
look like it contains relocations that do, so I'm not sure where
references to _GLOBAL_OFFSET_TABLE_ are coming from.
arch/powerpc/kernel/vdso32/Makefile | 7 +++++--
arch/powerpc/kernel/vdso32/vdso32.lds.S | 3 ++-
2 files changed, 7 insertions(+), 3 deletions(-)
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Requires dropping the .got section. I couldn't find how it was used in
the vdso32.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
Not sure removing .got is a good idea or not. Otherwise I observe the
following link error:
powerpc-linux-gnu-ld: warning: orphan section `.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.got'
powerpc-linux-gnu-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc-linux-gnu-ld: final link failed: bad value
sigtramp.c doesn't mention anything from the GOT AFAICT, and doesn't
look like it contains relocations that do, so I'm not sure where
references to _GLOBAL_OFFSET_TABLE_ are coming from.
I'm getting the same but only when building for PPC64.
I don't get any reference to sigtramp.o though:
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
VDSO32A arch/powerpc/kernel/vdso32/gettimeofday.o
VDSO32A arch/powerpc/kernel/vdso32/datapage.o
VDSO32A arch/powerpc/kernel/vdso32/cacheflush.o
VDSO32A arch/powerpc/kernel/vdso32/note.o
VDSO32A arch/powerpc/kernel/vdso32/getcpu.o
LD arch/powerpc/kernel/vdso32/vdso32.so.dbg
powerpc64-linux-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc64-linux-ld: final link failed: Bad value
(GCC 8.1, Binutils 2.30)
So it seems that the got section is being created by the linker. Don't
know why though.
With GCC 10.1, binutils 2.34 I get:
LDS arch/powerpc/kernel/vdso32/vdso32.lds
VDSO32A arch/powerpc/kernel/vdso32/sigtramp.o
VDSO32A arch/powerpc/kernel/vdso32/gettimeofday.o
VDSO32A arch/powerpc/kernel/vdso32/datapage.o
VDSO32A arch/powerpc/kernel/vdso32/cacheflush.o
VDSO32A arch/powerpc/kernel/vdso32/note.o
VDSO32A arch/powerpc/kernel/vdso32/getcpu.o
LD arch/powerpc/kernel/vdso32/vdso32.so.dbg
powerpc64-linux-ld: warning: orphan section `.branch_lt' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.branch_lt'
powerpc64-linux-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc64-linux-ld: final link failed: bad value
I can't see any .branch_lt section when objdumping sigtramp.o or any
other .o
When I move sigtramp.o at the end of the definition of obj-vdso32 in
Makefile, I then get:
powerpc64-linux-ld: warning: orphan section `.branch_lt' from
`arch/powerpc/kernel/vdso32/gettimeofday.o' being placed in section
`.branch_lt'
powerpc64-linux-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc64-linux-ld: final link failed: bad value
gettimeofday.o now being the first object in obj-vdso32
Christophe
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Requires dropping the .got section. I couldn't find how it was used in
the vdso32.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
Not sure removing .got is a good idea or not. Otherwise I observe the
following link error:
powerpc-linux-gnu-ld: warning: orphan section `.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.got'
powerpc-linux-gnu-ld: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
powerpc-linux-gnu-ld: final link failed: bad value
Finally I spotted it I think:
make arch/powerpc/kernel/vdso32/ V=1
powerpc64-linux-ld -EB -m elf64ppc -shared -soname linux-vdso32.so.1
--eh-frame-hdr --orphan-handling=warn -T
arch/powerpc/kernel/vdso32/vdso32.lds
arch/powerpc/kernel/vdso32/sigtramp.o
arch/powerpc/kernel/vdso32/gettimeofday.o
arch/powerpc/kernel/vdso32/datapage.o
arch/powerpc/kernel/vdso32/cacheflush.o
arch/powerpc/kernel/vdso32/note.o arch/powerpc/kernel/vdso32/getcpu.o -o
arch/powerpc/kernel/vdso32/vdso32.so.dbg
If I do the same manually but with -m elf32ppc instead of -m elf64ppc,
there is no failure.
Adding -m elf32ppc to ldflags-y also works, allthough I don't like too
much having "-m elf64ppc -m elf32ppc" on the line.
Christophe
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2020-09-02 12:14:43
Nick Desaulniers [off-list ref] writes:
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Ouch.
Seems make is quite happy to $(call deadbeef, ...) and not print a
warning, which I guess is probably a feature.
Painstakingly compared the output between `objdump -a` before and after
this change. Now function symbols have the correct type of FUNC rather
than NONE, and the entry is slightly different (which doesn't matter for
the vdso). Binary size is the same.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
[ Don't build as root :-P ]
Try with a newer ld? If it still happens with current versions, please
open a bug report? https://sourceware.org/bugzilla
Segher
But minimum for building kernel is supposed to be 2.23
Sure. Tthat could be upgraded to 2.24 -- you should use a binutils at
least as new as your GCC, and that requires 4.9 now -- but that
probably doesn't help you here).
Segher
From: Nick Desaulniers <ndesaulniers@google.com> Date: 2020-09-02 17:41:40
On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman [off-list ref] wrote:
Nick Desaulniers [off-list ref] writes:
quoted
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
I think I'll just revert that for v5.9 ?
SGTM; you'll probably still want these changes with some modifications
at some point; vdso32 did have at least one orphaned section, and will
be important for hermetic builds. Seeing crashes in supported
versions of the tools ties our hands at the moment.
--
Thanks,
~Nick Desaulniers
On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman [off-list ref] wrote:
quoted
Nick Desaulniers [off-list ref] writes:
quoted
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
I think I'll just revert that for v5.9 ?
SGTM; you'll probably still want these changes with some modifications
at some point; vdso32 did have at least one orphaned section, and will
be important for hermetic builds. Seeing crashes in supported
versions of the tools ties our hands at the moment.
Keeping the tool problem aside with binutils 2.26, do you have a way to
really link an elf32ppc object when building vdso32 for PPC64 ?
Christophe
From: Nick Desaulniers <ndesaulniers@google.com> Date: 2021-04-22 22:44:18
On Wed, Sep 2, 2020 at 11:02 AM Christophe Leroy
[off-list ref] wrote:
Le 02/09/2020 à 19:41, Nick Desaulniers a écrit :
quoted
On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman [off-list ref] wrote:
quoted
Nick Desaulniers [off-list ref] writes:
quoted
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
I think I'll just revert that for v5.9 ?
SGTM; you'll probably still want these changes with some modifications
at some point; vdso32 did have at least one orphaned section, and will
be important for hermetic builds. Seeing crashes in supported
versions of the tools ties our hands at the moment.
Keeping the tool problem aside with binutils 2.26, do you have a way to
really link an elf32ppc object when building vdso32 for PPC64 ?
Sorry, I'm doing a bug scrub and found
https://github.com/ClangBuiltLinux/linux/issues/774 still open (and my
reply to this thread still in Drafts; never sent). With my patches
rebased:
$ file arch/powerpc/kernel/vdso32/vdso32.so
arch/powerpc/kernel/vdso32/vdso32.so: ELF 32-bit MSB shared object,
PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, stripped
Are you still using 2.26?
I'm not able to repro Nathan's reported issue from
https://lore.kernel.org/lkml/20200902052123.GA2687902@ubuntu-n2-xlarge-x86/,
so I'm curious if I should resend the rebased patches as v2?
--
Thanks,
~Nick Desaulniers
On Wed, Sep 2, 2020 at 11:02 AM Christophe Leroy
[off-list ref] wrote:
quoted
Le 02/09/2020 à 19:41, Nick Desaulniers a écrit :
quoted
On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman [off-list ref] wrote:
quoted
Nick Desaulniers [off-list ref] writes:
quoted
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
I think I'll just revert that for v5.9 ?
SGTM; you'll probably still want these changes with some modifications
at some point; vdso32 did have at least one orphaned section, and will
be important for hermetic builds. Seeing crashes in supported
versions of the tools ties our hands at the moment.
Keeping the tool problem aside with binutils 2.26, do you have a way to
really link an elf32ppc object when building vdso32 for PPC64 ?
Sorry, I'm doing a bug scrub and found
https://github.com/ClangBuiltLinux/linux/issues/774 still open (and my
reply to this thread still in Drafts; never sent). With my patches
rebased:
$ file arch/powerpc/kernel/vdso32/vdso32.so
arch/powerpc/kernel/vdso32/vdso32.so: ELF 32-bit MSB shared object,
PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, stripped
Are you still using 2.26?
Yes, our production kernels and applications are built with gcc 5.5 and binutils 2.26
I can't remember what was all this discussion about.
I gave a try to your rebased patches.
Still an issue with binutils 2.26:
VDSO32L arch/powerpc/kernel/vdso32/vdso32.so.dbg
ppc-linux-ld: warning: orphan section `.rela.got' from `arch/powerpc/kernel/vdso32/sigtramp.o' being
placed in section `.rela.dyn'.
ppc-linux-ld: warning: orphan section `.rela.plt' from `arch/powerpc/kernel/vdso32/sigtramp.o' being
placed in section `.rela.dyn'.
ppc-linux-ld: warning: orphan section `.glink' from `arch/powerpc/kernel/vdso32/sigtramp.o' being
placed in section `.glink'.
ppc-linux-ld: warning: orphan section `.iplt' from `arch/powerpc/kernel/vdso32/sigtramp.o' being
placed in section `.iplt'.
ppc-linux-ld: warning: orphan section `.rela.iplt' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'.
ppc-linux-ld: warning: orphan section `.rela.text' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'.
/bin/sh: line 1: 7850 Segmentation fault (core dumped) ppc-linux-ld -EB -m elf32ppc -shared
-soname linux-vdso32.so.1 --eh-frame-hdr --orphan-handling=warn -T
arch/powerpc/kernel/vdso32/vdso32.lds arch/powerpc/kernel/vdso32/sigtramp.o
arch/powerpc/kernel/vdso32/gettimeofday.o arch/powerpc/kernel/vdso32/datapage.o
arch/powerpc/kernel/vdso32/cacheflush.o arch/powerpc/kernel/vdso32/note.o
arch/powerpc/kernel/vdso32/getcpu.o arch/powerpc/kernel/vdso32/vgettimeofday.o -o
arch/powerpc/kernel/vdso32/vdso32.so.dbg
make[2]: *** [arch/powerpc/kernel/vdso32/vdso32.so.dbg] Error 139
make[2]: *** Deleting file `arch/powerpc/kernel/vdso32/vdso32.so.dbg'
With gcc 10.1 and binutils 2.34 I get:
PPC32 build:
VDSO32L arch/powerpc/kernel/vdso32/vdso32.so.dbg
powerpc64-linux-ld: warning: orphan section `.rela.got' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.plt' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.glink' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.glink'
powerpc64-linux-ld: warning: orphan section `.iplt' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.iplt'
powerpc64-linux-ld: warning: orphan section `.rela.iplt' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.branch_lt' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.text' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
PPC64 build:
VDSO32L arch/powerpc/kernel/vdso32/vdso32.so.dbg
powerpc64-linux-ld: warning: orphan section `.rela.got' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.plt' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.glink' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.glink'
powerpc64-linux-ld: warning: orphan section `.iplt' from `arch/powerpc/kernel/vdso32/sigtramp.o'
being placed in section `.iplt'
powerpc64-linux-ld: warning: orphan section `.rela.iplt' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.branch_lt' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.text' from
`arch/powerpc/kernel/vdso32/sigtramp.o' being placed in section `.rela.dyn'
VDSOSYM include/generated/vdso32-offsets.h
VDSO64L arch/powerpc/kernel/vdso64/vdso64.so.dbg
powerpc64-linux-ld: warning: orphan section `.iplt' from `linker stubs' being placed in section `.iplt'
powerpc64-linux-ld: warning: orphan section `.rela.iplt' from `linker stubs' being placed in section
`.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.branch_lt' from `linker stubs' being placed in
section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.branch_lt' from `linker stubs' being placed in
section `.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.plt' from `linker stubs' being placed in section `.plt'
powerpc64-linux-ld: warning: orphan section `.rela.plt' from `linker stubs' being placed in section
`.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.got' from `linker stubs' being placed in section
`.rela.dyn'
powerpc64-linux-ld: warning: orphan section `.rela.opd' from `linker stubs' being placed in section
`.rela.dyn'
Christophe
On Wed, Sep 2, 2020 at 11:02 AM Christophe Leroy
[off-list ref] wrote:
quoted
Le 02/09/2020 à 19:41, Nick Desaulniers a écrit :
quoted
On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman [off-list ref] wrote:
quoted
Nick Desaulniers [off-list ref] writes:
quoted
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
I think I'll just revert that for v5.9 ?
SGTM; you'll probably still want these changes with some modifications
at some point; vdso32 did have at least one orphaned section, and will
be important for hermetic builds. Seeing crashes in supported
versions of the tools ties our hands at the moment.
Keeping the tool problem aside with binutils 2.26, do you have a way to
really link an elf32ppc object when building vdso32 for PPC64 ?
Sorry, I'm doing a bug scrub and found
https://github.com/ClangBuiltLinux/linux/issues/774 still open (and my
reply to this thread still in Drafts; never sent). With my patches
rebased:
$ file arch/powerpc/kernel/vdso32/vdso32.so
arch/powerpc/kernel/vdso32/vdso32.so: ELF 32-bit MSB shared object,
PowerPC or cisco 4500, version 1 (SYSV), dynamically linked, stripped
Are you still using 2.26?
I'm not able to repro Nathan's reported issue from
https://lore.kernel.org/lkml/20200902052123.GA2687902@ubuntu-n2-xlarge-x86/,
so I'm curious if I should resend the rebased patches as v2?
Rather than invoke the compiler as the driver, use the linker. That way
we can check --orphan-handling=warn support correctly, as cc-ldoption
was removed in
commit 055efab3120b ("kbuild: drop support for cc-ldoption").
Painstakingly compared the output between `objdump -a` before and after
this change. Now function symbols have the correct type of FUNC rather
than NONE, and the entry is slightly different (which doesn't matter for
the vdso). Binary size is the same.
Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections")
Link: https://lore.kernel.org/lkml/CAKwvOdnn3wxYdJomvnveyD_njwRku3fABWT_bS92duihhywLJQ@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Is this change still necessary ? If so please rebase as we have changed
the structure of VDSO source files (Only one directory common to 32 and 64).
Christophe