bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/12928] New: Wrong linker relaxation with DTPREL relocation on al


From: ubizjak at gmail dot com
Subject: [Bug ld/12928] New: Wrong linker relaxation with DTPREL relocation on alpha
Date: Fri, 24 Jun 2011 07:54:29 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=12928

           Summary: Wrong linker relaxation with DTPREL relocation on
                    alpha
           Product: binutils
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden


Created attachment 5818
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5818
Assembly code that fails with enabled linker relaxations

This is a followup from gcc PR 49515 [1].

Attached testcase fails with linker relaxations on alphaev68-pc-linux-gnu:

address@hidden ~ $ gcc thr-init-2.s 
address@hidden ~ $ ./a.out
a=2 fstat=33554434
Aborted
address@hidden ~ $ gcc -Wl,--no-relax thr-init-2.s 
address@hidden ~ $ ./a.out
address@hidden ~ $ 

ld --version
GNU ld (GNU Binutils) 2.21
Copyright 2010 Free Software Foundation, Inc.
...

But the bug also exists in latest snapshot:
GNU ld (GNU Binutils) 2.21.52.20110623

The c source:

--cut here--
/* { dg-do run } */
/* { dg-require-effective-target tls_runtime } */
/* { dg-add-options tls } */

extern int printf (char *,...);
extern void abort() ;

static __thread int fstat ;
static __thread int fstat = 1;
static __thread int fstat ;

int test_code(int b)
{
  fstat += b ;
  return fstat;
}

int main (int ac, char *av[])
{
  int a = test_code(1);

  if ( a != 2 || fstat != 2 )
    {
    printf ("a=%d fstat=%d\n", a, fstat) ;
    abort ();
    }

  return 0;
}
--cut here--

compiled with -O2 -fpic to produce attached assembly code.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49515

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]