Project

General

Profile

Actions

Bug #10267

closed

ld and GCC disagree about i386 local dynamic TLS

Added by Rich Lowe over 4 years ago. Updated over 4 years 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
Gerrit CR:
External Bug:

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

Actions #1

Updated by Electric Monk over 4 years ago

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

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>

Actions

Also available in: Atom PDF