[Issue 12092] New: Wrong TLS access in PIC (X86_32)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 6 16:32:34 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12092

           Summary: Wrong TLS access in PIC (X86_32)
           Product: D
           Version: unspecified
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Keywords: dll, wrong-code
          Severity: major
          Priority: P3
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2014-02-06 16:32:32 PST ---
cat > bug.d << CODE
int bar;

int foo()
{
    return bar;
}
CODE

dmd -m32 -c -fPIC bug.d
readelf -r bug.o
----
0000000b  0000160f R_386_TLS_IE      00000000   _D3foo3bari
----

This TLS relocation uses the 'initial exec' model, which is not suited for PIC
code. It should use the 'general dynamic' model (R_386_TLS_GD).

Reference http://www.akkadia.org/drepper/tls.pdf

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


More information about the Digitalmars-d-bugs mailing list