bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/19353] ld-new: internal error in relocate_tls, at ../../binuti


From: kristof.beyls at gmail dot com
Subject: [Bug gold/19353] ld-new: internal error in relocate_tls, at ../../binutils/gold/aarch64.cc:7418
Date: Tue, 05 Jan 2016 11:01:02 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=19353

Kristof Beyls <kristof.beyls at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kristof.beyls at gmail dot com

--- Comment #3 from Kristof Beyls <kristof.beyls at gmail dot com> ---
I hit the same assert when building LLVM's unit test on AArch64 with gold.
It seems the issue is triggered when linking to a thread-local variable in
dynamically linked library.

Reproducer 1:
$ cat reproduce_gold_crash.sh
cat > gold_crash_a1.c << INPUT
__thread void* tv;
INPUT

cat > gold_crash_b1.c << INPUT
extern __thread void* tv;
int main(int argc, char **argv) {
  tv = argv;
}
INPUT

gcc -O2 -fPIC -rdynamic -shared -Wl,-soname,gold_crash_a1.so.1 -o
libgold_crash_a1.so gold_crash_a1.c
gcc -O2 -fPIC -rdynamic -o gold_crash1.exe gold_crash_b1.c -L.  -lgold_crash_a1
$ PATH=$HOME/bin:$PATH ./reproduce_gold_crash.sh
/home/llvm-test/bin/ld: internal error in relocate_tls, at
../../binutils-gdb/gold/aarch64.cc:7418
collect2: error: ld returned 1 exit status


Reproducer 2:
$ cat call_once.cpp
#include <mutex>
#include <stdio.h>

std::once_flag flag1;

int main() {
  std::call_once(flag1, [](){puts("Hello!\n");});
}
$ PATH=$HOME/bin:$PATH g++ -O2 -fPIC -std=c++11 call_once.cpp
/home/llvm-test/bin/ld: internal error in relocate_tls, at
../../binutils-gdb/gold/aarch64.cc:7418
collect2: error: ld returned 1 exit status
$ PATH=$HOME/bin:$PATH ld -v
GNU gold (GNU Binutils 2.26.51.20160104) 1.11


I could also reproduce this with the following Debian versions of gold:
* GNU gold (GNU Binutils for Debian 2.25.1) 1.11
* GNU gold (GNU Binutils for Debian 2.25) 1.11

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]