www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5774] New: [64 bit] "relocation truncated to fit" with __gshared array, while(), and $

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5774

           Summary: [64 bit] "relocation truncated to fit" with __gshared
                    array, while(), and $
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: clugdbug yahoo.com.au



Cut down from a failure in core.cpuid. With all of the build problems with
druntime at the moment I'm not able to get any normal file to build on 64bits;
but this is the relevant case from the runtime build. This probably needs -O
-release, since it goes away if I replace 'while' with 'if'; but I haven't
checked which flags are actually necessary.

=============
__gshared char[48] dish;
void foo()
{
 int end = 0;
 while (dish[$-end-1]==0) { ++end; }
}
===========
src/core/cpuid.d:(.text._D4core5cpuid3fooFZv+0x9): relocation truncated to fit:
R_X86_64_PC32 against symbol `_D4core5cpuid4dishG48a' defined in .data section
in obj/core/cpuid.o

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 23 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5774


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



I can no longer reproduce this bug. I can revert the workaround, and the code
still links. I presume the root cause was fixed shortly after this bug was
filed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 22 2012