This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Another VTA issue on IA64
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 Sep 2009 14:10:47 -0700 (PDT)
- Subject: Another VTA issue on IA64
Alexandre,
I have run into another VTA issue on IA64 while building libgomp. If I
compile the following two C files on IA64 HP-UX and then link them into
a shared library using the HP linker I get an error from the HP linker.
============ x.c =============
struct gomp_team_state { };
struct gomp_thread
{
void (*fn) (void *data);
struct gomp_team_state ts;
};
extern __thread struct gomp_thread gomp_tls_data;
inline struct gomp_thread *gomp_thread (void)
{
return &gomp_tls_data;
}
GOMP_parallel_end (void)
{
struct gomp_team_state *ts = &gomp_thread ()->ts;
}
========== y.c ===============
struct gomp_team_state { };
struct gomp_thread
{
void (*fn) (void *data);
struct gomp_team_state ts;
};
__thread struct gomp_thread gomp_tls_data;
================
$ gcc -mlp64 -shared -fPIC -O2 -g x.c y.c
ld: Non TP-relative relocation for the thread local storage symbol "gomp_tls_data"
1 errors.
collect2: ld returned 1 exit status
If I look at the generated assembly code for x.c and y.c the .debug_info
section of x.c contains:
data8.ua gomp_tls_data#+8
while the .debug_info section of y.c contains:
data8.ua @dtprel(gomp_tls_data#)
If I change x.s by hand to use dtprel then the HP linker does not complain.
I see the same compiler output on IA64 Linux, but the GNU linker doesn't seem
to complain about this mismatch. I am not sure if this is a general problem
or an IA64 specific bug but I thought I would see if you had any ideas on what
the fix for this should be.
Let me know if you would like me to file a bug report for this. I am also
using your patch for PR debug/41248 while doing this testing since that
is the only way I can bootstrap IA64 HP-UX.
Steve Ellcey
sje@cup.hp.com