Skip to contentSkip to conversation

/usr/bin/powerpc64-linux-gnu-ld: warning: discarding dynamic section .rela.opd

PATCH Nick Desaulniers 2 participants 2 messages Aug 27, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · Christophe Leroy
Quoted 17 lines · kernel test robot
tree:   https://github.com/linuxppc/linux next-test
head:   f46b75a9ae95df302fcb070678773574f6812216
commit: 6dcaaad9830c73908a23200ccc5da12583e04f1a [70/80] powerpc/vdso: Switch VDSO to generic C implementation.
config: powerpc64-randconfig-r005-20200826 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 7cfcecece0e0430937cf529ce74d3a071a4dedc6)

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
git checkout 6dcaaad9830c73908a23200ccc5da12583e04f1a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate

Quoted 8 lines
Quoted 4 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

/usr/bin/powerpc64-linux-gnu-ld: warning: discarding dynamic section .rela.opd

We have /DISCARD/ *(.rela*) in the VDSO linker scripts.

What is going on here with clang ?

Looks like .rela.opd was maybe synthesized. cc Dr. Weigand, whos name shows up on llvm/test/MC/PowerPC/ppc64-relocs-01.s, which is the only hit I get in the codebase of opd (at least for tests, still looking to see if ".opd" gets appended somewhere.

Christophe, it might be interesting to find which object file contains that section pre-linking, then what symbols are in that section.

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw

Nick Desaulniers <[email protected]> wrote on 27.08.2020 14:52:36:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

All warnings (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

/usr/bin/powerpc64-linux-gnu-ld: warning: discarding dynamic

section .rela.opd

Quoted 2 lines
Quoted 1 line
Quoted 8 lines
Quoted 3 lines

We have /DISCARD/ *(.rela*) in the VDSO linker scripts.

What is going on here with clang ?

Looks like .rela.opd was maybe synthesized. cc Dr. Weigand, whos name shows up on llvm/test/MC/PowerPC/ppc64-relocs-01.s, which is the only hit I get in the codebase of opd (at least for tests, still looking to see if ".opd" gets appended somewhere.

Well, this is the old ELFv1 ABI for big-endian PowerPC, which uses function descriptors, which reside in the .opd section. These are emitted by LLVM in the PPCLinuxAsmPrinter::emitFunctionEntryLabel section, and they usually do require relocations since the function descriptor contains the address of the function text (however those relocations should be resolved during final link). I don't think there should be much difference between GCC and LLVM in how those are handled.

Alan Modra is really the expert on PowerPC linker issues, so I've added him on CC in case he has further comments.

Bye,
Ulrich