Project

General

Profile

Bug #10267

ld and GCC disagree about i386 local dynamic TLS

Added by Rich Lowe 11 months ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tools - gate/build tools
Start date:
2019-01-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

GCC emits R_386_TLS_LDM with a following R_386_PLT32 rather than
R_386_TLS_LDM_PLT, which causes ld to not relocate the 'call
__tls_get_addr', and leave a dangling 'call' in the output binary,
which will then crash unpredictably.

We should change the TLS_LDM implementation to always nop out the
following 'call', if there _is
a TLS_LDM_PLT, we'll nop it again when
processing that. If there isn't, no harm has been done.

This is the root cause of https://github.com/joyent/python-manta/issues/55 and https://github.com/joyent/smartos-live/issues/822

History

#1

Updated by Electric Monk 10 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

git commit 096c97d62be876a03a0a8cdb0a540e9c84ec509f

commit  096c97d62be876a03a0a8cdb0a540e9c84ec509f
Author: Richard Lowe <richlowe@richlowe.net>
Date:   2019-01-31T01:37:40.000Z

    10267 ld and GCC disagree about i386 local dynamic TLS
    Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
    Reviewed by: Jason King <jbk@joyent.com>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF