Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 2019 20:08:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 237068] /usr/local/bin/ld: BFD (GNU Binutils) 2.30 assertion fail elflink.c:2824
Message-ID:  <bug-237068-29464-lX8nGBgqr1@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-237068-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-237068-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237068

--- Comment #40 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Dimitry Andric from comment #27)

(In reply to Antoine Brodin from comment #37)

I've not managed to get 32-bit powerpc FreeBSD to build
llvm60 (or other such) using a gcc8/g++8 related toolchain:
same assertion.

I have reduced a reproduction technique for the g++8 context
for 32-bit powerpc FreeBSD -r347549 down to:

/usr/local/bin/ld \
-Bshareable \
-o lib/libLLVM-6.0.so \
/usr/local/lib/gcc8/gcc/powerpc-portbld-freebsd13.0/8.3.0/crtbeginS.o \
--gc-sections \
-soname libLLVM-6.0.so \
--version-script
/wrkdirs/usr/ports/devel/llvm60/work/.build/./lib/tools/llvm-shlib/simple_v=
ersion_script.map
\
--whole-archive \
lib/libLLVMSupport.a \
--no-whole-archive \
-ltinfo \
/usr/local/lib/gcc8/gcc/powerpc-portbld-freebsd13.0/8.3.0/crtendS.o

/usr/local/bin/ld \
-Bshareable \
-o lib/libLTO.so.6.0.1 \
/usr/local/lib/gcc8/gcc/powerpc-portbld-freebsd13.0/8.3.0/crtbeginS.o \
--gc-sections \
-soname \
libLTO.so.6 \
lib/libLLVM-6.0.so \
/usr/local/lib/gcc8/gcc/powerpc-portbld-freebsd13.0/8.3.0/crtendS.o

where lib/libLLVM-6.0.so ends up with:

# ldd lib/libLLVM-6.0.so
lib/libLLVM-6.0.so:
        libncurses.so.8 =3D> /lib/libncurses.so.8 (0x41e00000)
        libc.so.7 =3D> /lib/libc.so.7 (0x41862000)

# readelf -asW /lib/libncurses.so.8 | egrep '(bss|Symbol)'
   01     .ctors .dtors .jcr .data.rel.ro .dynamic .data .got .sdata .sbss =
.plt
.bss=20
  [21] .sbss             NOBITS          00057448 047448 000070 00  WA  0  =
 0=20
4
  [23] .bss              NOBITS          00058410 047448 00085c 00  WA  0  =
 0=20
8
Symbol table (.dynsym) contains 725 entries:
   474: 0000000000057448     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
Symbol table (.symtab) contains 752 entries:
   501: 0000000000057448     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start

(Note: __bss_start has the .sbss 00057448 .)

This ends up producing a lib/libLLVM-6.0.so with:

# readelf -asW lib/libLLVM-6.0.so | egrep '(bss|Symbol )'
   01     .tbss .init_array .ctors .dtors .data.rel.ro .got2 .dynamic .data
.got .sdata .sbss .plt .bss=20
   03     .tbss=20
  [13] .tbss             NOBITS          001522dc 1422dc 000004 00 WAT  0  =
 0=20
4
  [23] .sbss             NOBITS          001574b8 1474b8 000025 00  WA  0  =
 0=20
8
  [25] .bss              NOBITS          0015ac78 1474b8 001364 00  WA  0  =
 0=20
8
Symbol table (.dynsym) contains 2510 entries:
  1390: 00000000001574b8     0 NOTYPE  GLOBAL DEFAULT   23
__bss_start@@LLVM_6.0 (2)
Symbol table (.symtab) contains 3680 entries:
  2560: 00000000001574b8     0 NOTYPE  GLOBAL DEFAULT   23 __bss_start

In other words, the .dynsym ends up with the @@LLVM_6.0 added.

Removing either lib/libLLVMSupport.a or -ltinfo no longer gets
the assert but does not include as much.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237068-29464-lX8nGBgqr1>