[Bug debug/41438] New: [4.5 Regression] VTA: libgomp build fails due to inconsistent debug info

sje at cup dot hp dot com gcc-bugzilla@gcc.gnu.org
Tue Sep 22 21:12:00 GMT 2009


If I compile the included 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.

$ 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

While I do not get this error on IA64 Linux the compiler does generate the same
debug information as on HP-UX, the linker just doesn't complain.

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.

Here are the two C files, x.c and y.c:

============ 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;


-- 
           Summary: [4.5 Regression] VTA: libgomp build fails due to
                    inconsistent debug info
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: aoliva at gcc dot gnu dot org
        ReportedBy: sje at cup dot hp dot com
 GCC build triplet: ia64-hp-hpux11.23
  GCC host triplet: ia64-hp-hpux11.23
GCC target triplet: ia64-hp-hpux11.23


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41438



More information about the Gcc-bugs mailing list