Bug 12995 - gas should support R_386_TLS_GD_PLT, R_386_TLS_LDM_PLT relocs
Summary: gas should support R_386_TLS_GD_PLT, R_386_TLS_LDM_PLT relocs
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Rainer Orth
Depends on:
Blocks: 12996
  Show dependency treegraph
Reported: 2011-07-13 10:20 UTC by Rainer Orth
Modified: 2012-03-19 15:15 UTC (History)
1 user (show)

See Also:
Target: i?86-pc-solaris2.*
Last reconfirmed:

initial patch (1.92 KB, patch)
2012-03-19 15:15 UTC, Rainer Orth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2011-07-13 10:20:28 UTC
Until very recently, Sun ld required different code sequences for 32-bit TLS GD
and LD thand GNU ld, as documented in The Linker and Libraries Guide:



This went unnoticed for a long time since no GCC testcase exercised those TLS
access models.

This changed with the gcc patch discussed at


So to handle Solaris < 11 and older OpenSolaris releases, gas should add support
for those relocs to fix the resulting testsuite failures.

I have a patch for @tlsldmplt ready since that's the part that cannot be worked
around, but will extend it to also handle @tlsgdplt.
Comment 1 Rainer Orth 2012-03-19 15:08:28 UTC
Comment 2 Rainer Orth 2012-03-19 15:15:22 UTC
Created attachment 6293 [details]
initial patch

The patch above worked for me.  It allowed gcc mainline bootstraps with the 
patched gas and Sun ld to complete without regressions on i386-pc-solaris2.[89]
and i386-pc-solaris2.1[01], fixing the current TLS LD related testcase failures.

It currently lacks testcases, and it appears that it cannot be installed on
it's own: the resulting gld knows enough about the new relocs for the link tests
in gcc/configure.ac to succeed incorrectly, breaking the build later on.

I'll work on the ld side (PR ld/12996) later, but had a very hard time producing
anything even remotely useful when I last tried.