Browse Source

fdpic: fix ld.so crashing

Newer binutils is creating a section INIT_ARRAY from any .init_array
and .ctors in the code. When ld.so runs initialization functions for
loaded objects with _dl_run_init_array() it crashes on Bfin FDPIC
system. It is trying to execute the function in pthread.c, which is
no longer useful with the combined C library approach.
Gcc -Wl,-M debugging output was very useful to find the reason for
the INIT_ARRAY section.
Waldemar Brodkorb 6 years ago
parent
commit
fed9ddae48
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libpthread/linuxthreads/pthread.c

+ 1 - 1
libpthread/linuxthreads/pthread.c

@@ -243,7 +243,7 @@ int (*__pthread_timedsuspend)(pthread_descr, const struct timespec *) = __pthrea
       mask with e.g. sigsetjmp before creating the first thread);
    - a regular function called from pthread_create when needed. */
 
-static void pthread_initialize(void) __attribute__((constructor));
+static void pthread_initialize(void);
 
 libpthread_hidden_proto(pthread_attr_destroy)
 libpthread_hidden_proto(pthread_attr_init)