Skip to content

PowerPC linker warning: bss-plt forced due to {name}.o #136131

Closed
@tgross35

Description

@tgross35

Originally noted in #136096 (comment) when building libc, PowerPC can emit the following linker warning:

 warning: linker stderr: /usr/lib/gcc-cross/powerpc-linux-gnu/13/../../../../powerpc-linux-gnu/bin/ld: bss-plt forced due to /checkout/target/powerpc-unknown-linux-gnu/debug/deps/const_fn-5906628da0f5d31e.2bjw3mlsf69tu9e94ehzuvs4u.rcgu.o

I also noticed this previously in compiler_builtins rust-lang/compiler-builtins#667.

https://sourceware.org/binutils/docs/ld/PowerPC-ELF32.html says the following:

--bss-plt
Current PowerPC GCC accepts a ‘-msecure-plt’ option that generates code capable of using a newer PLT and GOT layout that has the security advantage of no executable section ever needing to be writable and no writable section ever being executable. PowerPC ld will generate this layout, including stubs to access the PLT, if all input files (including startup and static libraries) were compiled with ‘-msecure-plt’. ‘--bss-plt’ forces the old BSS PLT (and GOT layout) which can give slightly better performance.

--secure-plt
ld will use the new PLT and GOT layout if it is linking new ‘-fpic’ or ‘-fPIC’ code, but does not do so automatically when linking non-PIC code. This option requests the new PLT and GOT layout. A warning will be given if some object file requires the old style BSS PLT.

It sounds like secure-plt is the default but something about our object files forces a fallback to bss-plt.

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkersArea: linkers... you gotta love linkersC-bugCategory: This is a bug.L-linker_messagesLint: linker_messagesO-PowerPCTarget: PowerPC processorsO-linux-gnuOperating system: Linux with glibc (i.e. a bug that can't happen with musl)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions