Created attachment 14307 [details] Reproducer program runme.sh: ------------------------------------------------------------- #!/bin/bash BINUTILS_HOME=/home/dante/src/binutils/ppc64le export PATH="$BINUTILS_HOME/bin:$PATH" LD=gold ld.$LD -V | head -1 rm *.o *.c *.so >& /dev/null cat > foo.c <<- EOM #include <iostream> extern "C" { EOM for i in `seq 1 259`; do printf "int foo_%s();\n" $i >> foo.c done echo 'int use_all_undefs() {' >> foo.c for i in `seq 1 259`; do printf "foo_%s();\n" $i >> foo.c done echo 'return 1; }}' >> foo.c g++ -B$BINUTILS_HOME/bin -c -fPIC -mlongcall -o foo.o foo.c g++ ./foo.o -s -fuse-ld=$LD -B$BINUTILS_HOME/bin -shared -o ./libfoo.so ------------------------------------------------------------- gcc 12.1.0 on ppc64le (bug also happens on gcc 9.3.0): $ ./runme.sh GNU gold (GNU Binutils 2.39.0.20220826) 1.16 /home/dante/src/binutils/ppc64le/bin/ld.gold: internal error in get_output_view, at output.h:110 collect2: error: ld returned 1 exit status Works when LD=bfd. Also works without the "-s" option. Running binutils v2.39 configured with: ./configure --prefix=/tmp/dante --enable-shared --enable-plugins --enable-gold --enable-threads
Hi, Please increase that 259 number in the reproducer program in case you don't get the error message. I've noticed that on some hosts (RHEL 8) I had to increase that number to get an error. Thanks.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c21736aed1d4877e090df60362413669dbdc391d commit c21736aed1d4877e090df60362413669dbdc391d Author: Alan Modra <amodra@gmail.com> Date: Sun Sep 25 12:07:36 2022 +0930 PR29542, PowerPC gold internal error in get_output_view, We were attempting to set a BSS style section contents. PR 29542 * powerpc.cc (Output_data_plt_powerpc::do_write): Don't set .plt, .iplt or .lplt section contents when position independent.
The binutils-2_39-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=041c22e35de06d22566f4c71e4425c3351215e66 commit 041c22e35de06d22566f4c71e4425c3351215e66 Author: Alan Modra <amodra@gmail.com> Date: Sun Sep 25 12:07:36 2022 +0930 PR29542, PowerPC gold internal error in get_output_view, We were attempting to set a BSS style section contents. PR 29542 * powerpc.cc (Output_data_plt_powerpc::do_write): Don't set .plt, .iplt or .lplt section contents when position independent. (cherry picked from commit c21736aed1d4877e090df60362413669dbdc391d)
Fixed