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
Status: ASSIGNED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Rainer Orth
URL:
Keywords:
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:
Host:
Target: i?86-pc-solaris2.*
Build:
Last reconfirmed:


Attachments
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:

http://download.oracle.com/docs/cd/E19963-01/html/819-0690/chapter8-20.html#gentextid-20371

http://download.oracle.com/docs/cd/E19963-01/html/819-0690/chapter8-20.html#gentextid-20441

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

This changed with the gcc patch discussed at

http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01661.html

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
Mine.
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.

  Rainer