This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/19826] New: invalid pointer returned from __tls_get_addr with static linking
- From: "cbaylis at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 15 Mar 2016 13:18:36 +0000
- Subject: [Bug libc/19826] New: invalid pointer returned from __tls_get_addr with static linking
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19826
Bug ID: 19826
Summary: invalid pointer returned from __tls_get_addr with
static linking
Product: glibc
Version: 2.23
Status: NEW
Severity: normal
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: cbaylis at gcc dot gnu.org
CC: drepper.fsp at gmail dot com
Target Milestone: ---
[ created from http://gcc.gnu.org/PR68802 ]
The following program fails on ARM when statically linked:
#include <cstdio>
#include <thread>
__thread int __attribute__ ((tls_model ("global-dynamic"))) x = 10;
class Thread {
public:
void operator()(){
fprintf(stderr, "testing (%i) ...\n", x);
}
};
int main(void){
Thread t;
std::thread th(std::ref(t));
th.join();
return 0;
}
Compiling:
$ arm-unknown-linux-gnueabihf-g++ -o test_static -Wall -Wl,--whole-archive
-lpthread -Wl,--no-whole-archive -static tsimple.c
when run on a raspberry pi:
$ ./test_static
Segmentation fault
--
You are receiving this mail because:
You are on the CC list for the bug.